LogIt++
|
A set of macros used to configure the LogIt logging system. More...
Macros | |
#define | LOGIT_BASE_PATH {} |
Defines the base path used for log file paths. If LOGIT_BASE_PATH is not defined or is empty ({} ), the full path from __FILE__ will be used for log file paths. | |
#define | LOGIT_DEFAULT_COLOR logit::TextColor::LightGray |
Defines the default color for console output. If LOGIT_DEFAULT_COLOR is not defined, defaults to logit::TextColor::LightGray . | |
#define | LOGIT_CURRENT_TIMESTAMP_MS() |
Macro to get the current timestamp in milliseconds. If LOGIT_CURRENT_TIMESTAMP_MS is not defined, it uses std::chrono to return the current time in milliseconds. | |
Log Level Colors | |
Default colors for each log level. | |
#define | LOGIT_COLOR_TRACE logit::TextColor::DarkGray |
#define | LOGIT_COLOR_DEBUG logit::TextColor::Blue |
#define | LOGIT_COLOR_INFO logit::TextColor::Green |
#define | LOGIT_COLOR_WARN logit::TextColor::Yellow |
#define | LOGIT_COLOR_ERROR logit::TextColor::Red |
#define | LOGIT_COLOR_FATAL logit::TextColor::Magenta |
#define | LOGIT_COLOR_DEFAULT logit::TextColor::White |
File Logger Settings | |
Configuration macros for file-based loggers. | |
#define | LOGIT_CONSOLE_PATTERN "%H:%M:%S.%e | %^%N([%50!g:%#])%v%$" |
Defines the default log pattern for the console logger. If LOGIT_CONSOLE_PATTERN is not defined, it defaults to "%H:%M:%S.%e | %^%N([%50!g:%#])%v%$". | |
#define | LOGIT_FILE_LOGGER_PATH "data/logs" |
Defines the default directory path for log files. If LOGIT_FILE_LOGGER_PATH is not defined, it defaults to "data/logs". | |
#define | LOGIT_UNIQUE_FILE_LOGGER_PATH "data/logs/unique_logs" |
Defines the default directory path for unique log files. If LOGIT_UNIQUE_FILE_LOGGER_PATH is not defined, it defaults to "data/logs/unique_logs". | |
#define | LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS 30 |
Defines the number of days after which old log files are deleted. If LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS is not defined, it defaults to 30 days. | |
#define | LOGIT_FILE_LOGGER_PATTERN "[%Y-%m-%d %H:%M:%S.%e] [%g:%#] [%!] [thread:%t] [%l] %SC%v" |
Defines the default log pattern for file-based loggers. If LOGIT_FILE_LOGGER_PATTERN is not defined, it defaults to "[%Y-%m-%d %H:%M:%S.%e] [%g:%#] [%!] [thread:%t] [%l] %SC%v". | |
#define | LOGIT_UNIQUE_FILE_LOGGER_PATTERN "%v" |
Defines the default log pattern for unique file-based loggers. If LOGIT_UNIQUE_FILE_LOGGER_PATTERN is not defined, it defaults to "%v". | |
#define | LOGIT_UNIQUE_FILE_LOGGER_HASH_LENGTH 8 |
Defines the default hash length for unique file names. If LOGIT_UNIQUE_FILE_LOGGER_HASH_LENGTH is not defined, it defaults to 8. | |
A set of macros used to configure the LogIt logging system.
These macros control various aspects of the logging behavior, including paths, patterns, colors, timestamps, and retention policies.
Customizing Log File Paths
Customizing Console Output Colors
#define LOGIT_BASE_PATH {} |
Defines the base path used for log file paths. If LOGIT_BASE_PATH
is not defined or is empty ({}
), the full path from __FILE__
will be used for log file paths.
Definition at line 30 of file LogItConfig.hpp.
#define LOGIT_COLOR_DEBUG logit::TextColor::Blue |
Definition at line 49 of file LogItConfig.hpp.
#define LOGIT_COLOR_DEFAULT logit::TextColor::White |
Definition at line 69 of file LogItConfig.hpp.
#define LOGIT_COLOR_ERROR logit::TextColor::Red |
Definition at line 61 of file LogItConfig.hpp.
#define LOGIT_COLOR_FATAL logit::TextColor::Magenta |
Definition at line 65 of file LogItConfig.hpp.
#define LOGIT_COLOR_INFO logit::TextColor::Green |
Definition at line 53 of file LogItConfig.hpp.
#define LOGIT_COLOR_TRACE logit::TextColor::DarkGray |
Definition at line 45 of file LogItConfig.hpp.
#define LOGIT_COLOR_WARN logit::TextColor::Yellow |
Definition at line 57 of file LogItConfig.hpp.
#define LOGIT_CONSOLE_PATTERN "%H:%M:%S.%e | %^%N([%50!g:%#])%v%$" |
Defines the default log pattern for the console logger. If LOGIT_CONSOLE_PATTERN
is not defined, it defaults to "%H:%M:%S.%e | %^%N([%50!g:%#])%v%$".
This pattern controls the formatting of log messages sent to the console, including timestamp, message, and color.
Definition at line 92 of file LogItConfig.hpp.
#define LOGIT_CURRENT_TIMESTAMP_MS | ( | ) |
Macro to get the current timestamp in milliseconds. If LOGIT_CURRENT_TIMESTAMP_MS is not defined, it uses std::chrono
to return the current time in milliseconds.
This macro can be overridden to provide a custom method for generating timestamps if needed.
Definition at line 78 of file LogItConfig.hpp.
#define LOGIT_DEFAULT_COLOR logit::TextColor::LightGray |
Defines the default color for console output. If LOGIT_DEFAULT_COLOR is not defined, defaults to logit::TextColor::LightGray
.
This macro allows setting a default console text color for log messages.
Definition at line 38 of file LogItConfig.hpp.
#define LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS 30 |
Defines the number of days after which old log files are deleted. If LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS
is not defined, it defaults to 30 days.
This macro controls the log file retention policy by specifying the maximum age of log files.
Definition at line 118 of file LogItConfig.hpp.
#define LOGIT_FILE_LOGGER_PATH "data/logs" |
Defines the default directory path for log files. If LOGIT_FILE_LOGGER_PATH
is not defined, it defaults to "data/logs".
This macro specifies the directory where regular log files will be stored. The default path is relative to the application's execution directory.
Definition at line 101 of file LogItConfig.hpp.
#define LOGIT_FILE_LOGGER_PATTERN "[%Y-%m-%d %H:%M:%S.%e] [%g:%#] [%!] [thread:%t] [%l] %SC%v" |
Defines the default log pattern for file-based loggers. If LOGIT_FILE_LOGGER_PATTERN
is not defined, it defaults to "[%Y-%m-%d %H:%M:%S.%e] [%g:%#] [%!] [thread:%t] [%l] %SC%v".
This pattern controls the formatting of log messages written to log files, including timestamp, filename, line number, function, and thread information.
Definition at line 127 of file LogItConfig.hpp.
#define LOGIT_UNIQUE_FILE_LOGGER_HASH_LENGTH 8 |
Defines the default hash length for unique file names. If LOGIT_UNIQUE_FILE_LOGGER_HASH_LENGTH
is not defined, it defaults to 8.
Definition at line 139 of file LogItConfig.hpp.
#define LOGIT_UNIQUE_FILE_LOGGER_PATH "data/logs/unique_logs" |
Defines the default directory path for unique log files. If LOGIT_UNIQUE_FILE_LOGGER_PATH
is not defined, it defaults to "data/logs/unique_logs".
This macro specifies the directory where unique log files, created by UniqueFileLogger
, will be stored. Each log message will generate a new file in this directory.
Definition at line 110 of file LogItConfig.hpp.
#define LOGIT_UNIQUE_FILE_LOGGER_PATTERN "%v" |
Defines the default log pattern for unique file-based loggers. If LOGIT_UNIQUE_FILE_LOGGER_PATTERN
is not defined, it defaults to "%v".
Definition at line 133 of file LogItConfig.hpp.