LogIt++
Loading...
Searching...
No Matches
LogItConfig.hpp File Reference

Configuration macros for the LogIt logging system. More...

Go to the source code of this file.

Macros

#define _LOGIT_CONFIG_HPP_INCLUDED
 
#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   TextColor::LightGray
 Defines the default color for console output. If LOGIT_DEFAULT_COLOR is not defined, defaults to TextColor::LightGray.
 
#define LOGIT_COLOR_TRACE   TextColor::DarkGray
 
#define LOGIT_COLOR_DEBUG   TextColor::Blue
 
#define LOGIT_COLOR_INFO   TextColor::Green
 
#define LOGIT_COLOR_WARN   TextColor::Yellow
 
#define LOGIT_COLOR_ERROR   TextColor::Red
 
#define LOGIT_COLOR_FATAL   TextColor::Magenta
 
#define LOGIT_COLOR_DEFAULT   TextColor::White
 
#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.
 
#define LOGIT_CONSOLE_PATTERN   "%H:%M:%S.%e | %^%v%$"
 Defines the default log pattern for the console logger. If LOGIT_CONSOLE_PATTERN is not defined, it defaults to "%H:%M:%S.%e | %^%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] [%ffn:%#] [%!] [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] [%ffn:%#] [%!] [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.
 

Detailed Description

Configuration macros for the LogIt logging system.

Definition in file LogItConfig.hpp.

Macro Definition Documentation

◆ _LOGIT_CONFIG_HPP_INCLUDED

#define _LOGIT_CONFIG_HPP_INCLUDED

Definition at line 3 of file LogItConfig.hpp.

◆ LOGIT_BASE_PATH

#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 10 of file LogItConfig.hpp.

◆ LOGIT_COLOR_DEBUG

#define LOGIT_COLOR_DEBUG   TextColor::Blue

Definition at line 26 of file LogItConfig.hpp.

◆ LOGIT_COLOR_DEFAULT

#define LOGIT_COLOR_DEFAULT   TextColor::White

Definition at line 46 of file LogItConfig.hpp.

◆ LOGIT_COLOR_ERROR

#define LOGIT_COLOR_ERROR   TextColor::Red

Definition at line 38 of file LogItConfig.hpp.

◆ LOGIT_COLOR_FATAL

#define LOGIT_COLOR_FATAL   TextColor::Magenta

Definition at line 42 of file LogItConfig.hpp.

◆ LOGIT_COLOR_INFO

#define LOGIT_COLOR_INFO   TextColor::Green

Definition at line 30 of file LogItConfig.hpp.

◆ LOGIT_COLOR_TRACE

#define LOGIT_COLOR_TRACE   TextColor::DarkGray

Definition at line 22 of file LogItConfig.hpp.

◆ LOGIT_COLOR_WARN

#define LOGIT_COLOR_WARN   TextColor::Yellow

Definition at line 34 of file LogItConfig.hpp.

◆ LOGIT_CONSOLE_PATTERN

#define LOGIT_CONSOLE_PATTERN   "%H:%M:%S.%e | %^%v%$"

Defines the default log pattern for the console logger. If LOGIT_CONSOLE_PATTERN is not defined, it defaults to "%H:%M:%S.%e | %^%v%$".

This pattern controls the formatting of log messages sent to the console, including timestamp, message, and color.

Definition at line 64 of file LogItConfig.hpp.

◆ LOGIT_CURRENT_TIMESTAMP_MS

#define LOGIT_CURRENT_TIMESTAMP_MS ( )
Value:
(std::chrono::duration_cast<std::chrono::milliseconds>( \
std::chrono::system_clock::now().time_since_epoch()).count())

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 54 of file LogItConfig.hpp.

◆ LOGIT_DEFAULT_COLOR

#define LOGIT_DEFAULT_COLOR   TextColor::LightGray

Defines the default color for console output. If LOGIT_DEFAULT_COLOR is not defined, defaults to TextColor::LightGray.

This macro allows setting a default console text color for log messages.

Definition at line 18 of file LogItConfig.hpp.

◆ LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS

#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 90 of file LogItConfig.hpp.

◆ LOGIT_FILE_LOGGER_PATH

#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 73 of file LogItConfig.hpp.

◆ LOGIT_FILE_LOGGER_PATTERN

#define LOGIT_FILE_LOGGER_PATTERN   "[%Y-%m-%d %H:%M:%S.%e] [%ffn:%#] [%!] [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] [%ffn:%#] [%!] [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 99 of file LogItConfig.hpp.

◆ LOGIT_UNIQUE_FILE_LOGGER_HASH_LENGTH

#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 111 of file LogItConfig.hpp.

◆ LOGIT_UNIQUE_FILE_LOGGER_PATH

#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 82 of file LogItConfig.hpp.

◆ LOGIT_UNIQUE_FILE_LOGGER_PATTERN

#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 105 of file LogItConfig.hpp.