Consolix
Loading...
Searching...
No Matches
config_macros.hpp File Reference

Configuration macros for the Consolix framework. More...

Go to the source code of this file.

Macros

#define _CONSOLIX_CONFIG_MACROS_HPP_INCLUDED
 
#define CONSOLIX_USE_LOGIT   0
 Enables or disables the use of the LogIt library.
 
#define CONSOLIX_USE_CXXOPTS   0
 Enables or disables the use of the cxxopts library for command-line arguments.
 
#define CONSOLIX_USE_JSON   0
 Enables or disables the use of the nlohmann/json library for JSON handling.
 
#define CONSOLIX_BASE_PATH   {}
 Defines the base path for resolving relative paths.
 
#define CONSOLIX_CONSOLE_PATTERN   LOGIT_CONSOLE_PATTERN
 Console log message pattern.
 
#define CONSOLIX_CONSOLE_DEBUG_PATTERN   "%H:%M:%S.%e | [%25!g:%#] [%l] %^%v%$"
 Debug console log message pattern.
 
#define CONSOLIX_FILE_LOGGER_PATTERN   LOGIT_FILE_LOGGER_PATTERN
 File log message pattern.
 
#define CONSOLIX_FILE_LOGGER_PATH   LOGIT_FILE_LOGGER_PATH
 Default file logger path.
 
#define CONSOLIX_UNIQUE_FILE_LOGGER_PATH   LOGIT_UNIQUE_FILE_LOGGER_PATH
 Default unique file logger path.
 
#define CONSOLIX_FILE_LOGGER_AUTO_DELETE_DAYS   LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS
 Auto-delete log files older than the specified number of days.
 
#define CONSOLIX_UNIQUE_FILE_LOGGER_HASH_LENGTH   LOGIT_UNIQUE_FILE_LOGGER_HASH_LENGTH
 Default hash length for unique file names.
 
#define CONSOLIX_DEFAULT_COLOR   consolix::TextColor::LightGray
 Default text color for console output.
 
#define CONSOLIX_WAIT_ON_ERROR   0
 Enables or disables waiting for user input before exiting on a fatal error.
 

Detailed Description

Configuration macros for the Consolix framework.

This file provides a centralized definition of macros used for configuring and customizing the behavior of the Consolix framework. By defining these macros, developers can enable or disable certain features and control the formatting of log messages and other behavior.

Purpose:

  • Centralize configuration macros.
  • Simplify customization of the Consolix framework.
  • Provide detailed documentation for each macro.

Usage:

Define macros as needed before including Consolix headers:

#define CONSOLIX_USE_LOGIT 1
#define CONSOLIX_FILE_LOGGER_PATH "logs/app.log"
Single include header for Consolix framework.

Definition in file config_macros.hpp.

Macro Definition Documentation

◆ _CONSOLIX_CONFIG_MACROS_HPP_INCLUDED

#define _CONSOLIX_CONFIG_MACROS_HPP_INCLUDED

Definition at line 3 of file config_macros.hpp.

◆ CONSOLIX_BASE_PATH

#define CONSOLIX_BASE_PATH   {}

Defines the base path for resolving relative paths.

Set to an empty object {} by default. \default {}

Definition at line 55 of file config_macros.hpp.

◆ CONSOLIX_CONSOLE_DEBUG_PATTERN

#define CONSOLIX_CONSOLE_DEBUG_PATTERN   "%H:%M:%S.%e | [%25!g:%#] [%l] %^%v%$"

Debug console log message pattern.

A specialized format for detailed debug messages. \default "%H:%M:%S.%e | [%25!g:%#] [%l] %^%v%$"

Definition at line 71 of file config_macros.hpp.

◆ CONSOLIX_CONSOLE_PATTERN

#define CONSOLIX_CONSOLE_PATTERN   LOGIT_CONSOLE_PATTERN

Console log message pattern.

Specifies the default format for log messages printed to the console. \default LOGIT_CONSOLE_PATTERN

Definition at line 63 of file config_macros.hpp.

◆ CONSOLIX_DEFAULT_COLOR

#define CONSOLIX_DEFAULT_COLOR   consolix::TextColor::LightGray

Default text color for console output.

Sets the default color for console output to LightGray. \default consolix::TextColor::LightGray

Definition at line 119 of file config_macros.hpp.

◆ CONSOLIX_FILE_LOGGER_AUTO_DELETE_DAYS

#define CONSOLIX_FILE_LOGGER_AUTO_DELETE_DAYS   LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS

Auto-delete log files older than the specified number of days.

Automatically removes log files that exceed the defined retention period. \default LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS

Definition at line 103 of file config_macros.hpp.

◆ CONSOLIX_FILE_LOGGER_PATH

#define CONSOLIX_FILE_LOGGER_PATH   LOGIT_FILE_LOGGER_PATH

Default file logger path.

Specifies the directory where general log files are stored. \default LOGIT_FILE_LOGGER_PATH

Definition at line 87 of file config_macros.hpp.

◆ CONSOLIX_FILE_LOGGER_PATTERN

#define CONSOLIX_FILE_LOGGER_PATTERN   LOGIT_FILE_LOGGER_PATTERN

File log message pattern.

Specifies the default format for log messages written to files. \default LOGIT_FILE_LOGGER_PATTERN

Definition at line 79 of file config_macros.hpp.

◆ CONSOLIX_UNIQUE_FILE_LOGGER_HASH_LENGTH

#define CONSOLIX_UNIQUE_FILE_LOGGER_HASH_LENGTH   LOGIT_UNIQUE_FILE_LOGGER_HASH_LENGTH

Default hash length for unique file names.

Determines the number of characters in the hash portion of unique file names. \default LOGIT_UNIQUE_FILE_LOGGER_HASH_LENGTH

Definition at line 111 of file config_macros.hpp.

◆ CONSOLIX_UNIQUE_FILE_LOGGER_PATH

#define CONSOLIX_UNIQUE_FILE_LOGGER_PATH   LOGIT_UNIQUE_FILE_LOGGER_PATH

Default unique file logger path.

Specifies the directory where unique log files are stored. \default LOGIT_UNIQUE_FILE_LOGGER_PATH

Definition at line 95 of file config_macros.hpp.

◆ CONSOLIX_USE_CXXOPTS

#define CONSOLIX_USE_CXXOPTS   0

Enables or disables the use of the cxxopts library for command-line arguments.

Set to 1 to enable cxxopts, or 0 to disable it. \default 0

Definition at line 39 of file config_macros.hpp.

◆ CONSOLIX_USE_JSON

#define CONSOLIX_USE_JSON   0

Enables or disables the use of the nlohmann/json library for JSON handling.

Set to 1 to enable JSON functionality, or 0 to disable it. \default 0

Definition at line 47 of file config_macros.hpp.

◆ CONSOLIX_USE_LOGIT

#define CONSOLIX_USE_LOGIT   0

Enables or disables the use of the LogIt library.

Set to 1 to enable LogIt, or 0 to disable it. \default 0

Definition at line 31 of file config_macros.hpp.

◆ CONSOLIX_WAIT_ON_ERROR

#define CONSOLIX_WAIT_ON_ERROR   0

Enables or disables waiting for user input before exiting on a fatal error.

Set to 1 to wait for Enter after a fatal error (useful for debugging), or 0 to exit immediately. \default 0

Definition at line 128 of file config_macros.hpp.