![]() |
LogIt++
Header-only, macro-first C++ logging library
|
Configuration macros for the LogIt logging system. More...
Go to the source code of this file.
Macros | |
| #define | LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_CONFIG_HPP_INCLUDED |
| #define | LOGIT_WALLCLOCK_MS() |
| #define | LOGIT_MONOTONIC_MS() |
| #define | LOGIT_CURRENT_TIMESTAMP_MS() |
| Macro to get the current timestamp in milliseconds. | |
| #define | LOGIT_BASE_PATH {} |
| Defines the base path used for log file paths. | |
| #define | LOGIT_DEFAULT_COLOR logit::TextColor::LightGray |
| Defines the default color for console output. | |
| #define | LOGIT_TASK_EXECUTOR_BLOCK_WAIT_USEC 200 |
| Defines the sleep duration (in microseconds) used by TaskExecutor when blocking producers. | |
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. | |
| #define | LOGIT_FILE_LOGGER_PATH "data/logs" |
| Defines the default directory path for log files. | |
| #define | LOGIT_UNIQUE_FILE_LOGGER_PATH "data/logs/unique_logs" |
| Defines the default directory path for unique log files. | |
| #define | LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS 30 |
| Defines the number of days after which old log files are deleted. | |
| #define | LOGIT_FILE_LOGGER_PATTERN "[%Y-%m-%d %H:%M:%S.%e] [%-5l] [%60!@] [thread:%t] %SC%v" |
| Defines the default log pattern for file-based loggers. | |
| #define | LOGIT_FILE_LOGGER_MAX_FILE_SIZE_BYTES 0 |
| #define | LOGIT_FILE_LOGGER_MAX_ROTATED_FILES 0 |
| #define | LOGIT_UNIQUE_FILE_LOGGER_PATTERN "%v" |
| Defines the default log pattern for unique file-based loggers. | |
| #define | LOGIT_UNIQUE_FILE_LOGGER_HASH_LENGTH 8 |
| Defines the default hash length for unique file names. | |
Tag formatting | |
Configuration of how tags are rendered after the message. | |
| #define | LOGIT_TAGS_JOIN " | " |
| Separator inserted between the main message and the tag list (e.g., " | "). | |
| #define | LOGIT_OS_ERROR_JOIN " | " |
| Separator appended before platform error metadata when formatting system error messages. | |
| #define | LOGIT_POSIX_ERROR_PATTERN "%s" LOGIT_OS_ERROR_JOIN "errno=%d (%s)" |
Format string used when appending POSIX errno information to a log message. | |
| #define | LOGIT_WINDOWS_ERROR_PATTERN "%s" LOGIT_OS_ERROR_JOIN "GetLastError=%lu (%s)" |
Format string used when appending Windows GetLastError details to a log message. | |
| #define | LOGIT_SYSTEM_ERROR_PATTERN LOGIT_POSIX_ERROR_PATTERN |
| Selects the default system error formatting macro for the current platform. | |
| #define | LOGIT_TAG_PAIR_SEP " " |
| Separator between individual tag pairs (e.g., " " or "; "). | |
| #define | LOGIT_TAG_KV_SEP "=" |
| Separator between a tag key and its value. | |
| #define | LOGIT_TAG_QUOTE_VALUES 1 |
| When 1, quote values that contain spaces or special characters; 0 disables quoting. | |
Task executor settings | |
Configuration options for the task executor implementation. | |
| #define | LOGIT_TASK_EXECUTOR_DRAIN_BUDGET 2048 |
| Maximum number of tasks drained per worker iteration in ring-buffer builds. | |
| #define | LOGIT_TASK_EXECUTOR_DEFAULT_RING_CAPACITY 1024 |
| Default capacity for the task executor ring buffer when unlimited is requested. | |
Configuration macros for the LogIt logging system.
Definition in file config.hpp.
| #define LOGIT_COLOR_DEBUG logit::TextColor::Blue |
Definition at line 43 of file config.hpp.
| #define LOGIT_COLOR_DEFAULT logit::TextColor::White |
Definition at line 63 of file config.hpp.
| #define LOGIT_COLOR_ERROR logit::TextColor::Red |
Definition at line 55 of file config.hpp.
| #define LOGIT_COLOR_FATAL logit::TextColor::Magenta |
Definition at line 59 of file config.hpp.
| #define LOGIT_COLOR_INFO logit::TextColor::Green |
Definition at line 47 of file config.hpp.
| #define LOGIT_COLOR_TRACE logit::TextColor::DarkGray |
Definition at line 39 of file config.hpp.
| #define LOGIT_COLOR_WARN logit::TextColor::Yellow |
Definition at line 51 of file config.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 96 of file config.hpp.
| #define LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_CONFIG_HPP_INCLUDED |
Definition at line 3 of file config.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 84 of file config.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 122 of file config.hpp.
| #define LOGIT_FILE_LOGGER_MAX_FILE_SIZE_BYTES 0 |
Definition at line 134 of file config.hpp.
| #define LOGIT_FILE_LOGGER_MAX_ROTATED_FILES 0 |
Definition at line 137 of file config.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 105 of file config.hpp.
| #define LOGIT_FILE_LOGGER_PATTERN "[%Y-%m-%d %H:%M:%S.%e] [%-5l] [%60!@] [thread:%t] %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] [%-5l] [%60!@] [thread:%t] %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 130 of file config.hpp.
| #define LOGIT_MONOTONIC_MS | ( | ) |
Definition at line 74 of file config.hpp.
| #define LOGIT_OS_ERROR_JOIN " | " |
Separator appended before platform error metadata when formatting system error messages.
Override to customize how human-readable messages and error codes are joined in log output.
Definition at line 166 of file config.hpp.
| #define LOGIT_POSIX_ERROR_PATTERN "%s" LOGIT_OS_ERROR_JOIN "errno=%d (%s)" |
Format string used when appending POSIX errno information to a log message.
This macro can be overridden to change how the user message, errno value, and description are rendered.
Definition at line 172 of file config.hpp.
| #define LOGIT_SYSTEM_ERROR_PATTERN LOGIT_POSIX_ERROR_PATTERN |
Selects the default system error formatting macro for the current platform.
Users may redefine this alias to integrate custom error formatting logic.
Definition at line 189 of file config.hpp.
| #define LOGIT_TAG_KV_SEP "=" |
Separator between a tag key and its value.
Definition at line 200 of file config.hpp.
| #define LOGIT_TAG_PAIR_SEP " " |
Separator between individual tag pairs (e.g., " " or "; ").
Definition at line 195 of file config.hpp.
| #define LOGIT_TAG_QUOTE_VALUES 1 |
When 1, quote values that contain spaces or special characters; 0 disables quoting.
Definition at line 205 of file config.hpp.
| #define LOGIT_TAGS_JOIN " | " |
Separator inserted between the main message and the tag list (e.g., " | ").
Definition at line 160 of file config.hpp.
| #define LOGIT_TASK_EXECUTOR_DEFAULT_RING_CAPACITY 1024 |
Default capacity for the task executor ring buffer when unlimited is requested.
Definition at line 224 of file config.hpp.
| #define LOGIT_TASK_EXECUTOR_DRAIN_BUDGET 2048 |
Maximum number of tasks drained per worker iteration in ring-buffer builds.
If LOGIT_TASK_EXECUTOR_DRAIN_BUDGET is not defined, the worker drains up to 2048 tasks before yielding. Increase the value to process larger bursts before sleeping, or reduce it to prioritise lower per-iteration latency.
Definition at line 219 of file config.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 149 of file config.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 114 of file config.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 143 of file config.hpp.
| #define LOGIT_WALLCLOCK_MS | ( | ) |
Definition at line 68 of file config.hpp.
| #define LOGIT_WINDOWS_ERROR_PATTERN "%s" LOGIT_OS_ERROR_JOIN "GetLastError=%lu (%s)" |
Format string used when appending Windows GetLastError details to a log message.
This macro can be overridden to adjust how the original text, numeric code, and decoded message are displayed.
Definition at line 178 of file config.hpp.