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

Provides various logging macros for different log levels and options. More...

Go to the source code of this file.

Macros

#define _LOGIT_LOG_MACROS_HPP_INCLUDED
 
#define LOGIT_LOG_AND_RETURN_NOARGS(level, format)
 Logs a message without arguments.
 
#define LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(level, index, format)
 Logs a message to a specific logger without arguments.
 
#define LOGIT_LOG_AND_RETURN(level, format, arg_names, ...)
 Logs a message with arguments.
 
#define LOGIT_LOG_AND_RETURN_PRINT(level, arg_names, ...)
 Logs a message with arguments, but prints them without using a format string.
 
#define LOGIT_LOG_AND_RETURN_WITH_INDEX(level, index, format, arg_names, ...)
 Logs a message with arguments to a specific logger.
 
#define LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(level, index, arg_names, ...)
 Logs a message with arguments to a specific logger, but prints them without using a format string.
 
#define LOGIT_TRACE(...)
 
#define LOGIT_TRACE0()
 
#define LOGIT_0TRACE()
 
#define LOGIT_0_TRACE()
 
#define LOGIT_NOARGS_TRACE()
 
#define LOGIT_FORMAT_TRACE(fmt, ...)
 
#define LOGIT_PRINT_TRACE(...)
 
#define LOGIT_PRINTF_TRACE(fmt, ...)
 
#define LOGIT_TRACE_TO(index, ...)
 
#define LOGIT_TRACE0_TO(index)
 
#define LOGIT_0TRACE_TO(index)
 
#define LOGIT_0_TRACE_TO(index)
 
#define LOGIT_NOARGS_TRACE_TO(index)
 
#define LOGIT_FORMAT_TRACE_TO(index, fmt, ...)
 
#define LOGIT_PRINT_TRACE_TO(index, ...)
 
#define LOGIT_PRINTF_TRACE_TO(index, fmt, ...)
 
#define LOGIT_INFO(...)
 
#define LOGIT_INFO0()
 
#define LOGIT_0INFO()
 
#define LOGIT_0_INFO()
 
#define LOGIT_NOARGS_INFO()
 
#define LOGIT_FORMAT_INFO(fmt, ...)
 
#define LOGIT_PRINT_INFO(...)
 
#define LOGIT_PRINTF_INFO(fmt, ...)
 
#define LOGIT_INFO_TO(index, ...)
 
#define LOGIT_INFO0_TO(index)
 
#define LOGIT_0INFO_TO(index)
 
#define LOGIT_0_INFO_TO(index)
 
#define LOGIT_NOARGS_INFO_TO(index)
 
#define LOGIT_FORMAT_INFO_TO(index, fmt, ...)
 
#define LOGIT_PRINT_INFO_TO(index, ...)
 
#define LOGIT_PRINTF_INFO_TO(index, fmt, ...)
 
#define LOGIT_DEBUG(...)
 
#define LOGIT_DEBUG0()
 
#define LOGIT_0DEBUG()
 
#define LOGIT_0_DEBUG()
 
#define LOGIT_NOARGS_DEBUG()
 
#define LOGIT_FORMAT_DEBUG(fmt, ...)
 
#define LOGIT_PRINT_DEBUG(...)
 
#define LOGIT_PRINTF_DEBUG(fmt, ...)
 
#define LOGIT_DEBUG_TO(index, ...)
 
#define LOGIT_DEBUG0_TO(index)
 
#define LOGIT_0DEBUG_TO(index)
 
#define LOGIT_0_DEBUG_TO(index)
 
#define LOGIT_NOARGS_DEBUG_TO(index)
 
#define LOGIT_FORMAT_DEBUG_TO(index, fmt, ...)
 
#define LOGIT_PRINT_DEBUG_TO(index, ...)
 
#define LOGIT_PRINTF_DEBUG_TO(index, fmt, ...)
 
#define LOGIT_WARN(...)
 
#define LOGIT_WARN0()
 
#define LOGIT_0WARN()
 
#define LOGIT_0_WARN()
 
#define LOGIT_NOARGS_WARN()
 
#define LOGIT_FORMAT_WARN(fmt, ...)
 
#define LOGIT_PRINT_WARN(...)
 
#define LOGIT_PRINTF_WARN(fmt, ...)
 
#define LOGIT_WARN_TO(index, ...)
 
#define LOGIT_WARN0_TO(index)
 
#define LOGIT_0WARN_TO(index)
 
#define LOGIT_0_WARN_TO(index)
 
#define LOGIT_NOARGS_WARN_TO(index)
 
#define LOGIT_FORMAT_WARN_TO(index, fmt, ...)
 
#define LOGIT_PRINT_WARN_TO(index, ...)
 
#define LOGIT_PRINTF_WARN_TO(index, fmt, ...)
 
#define LOGIT_ERROR(...)
 
#define LOGIT_ERROR0()
 
#define LOGIT_0ERROR()
 
#define LOGIT_0_ERROR()
 
#define LOGIT_NOARGS_ERROR()
 
#define LOGIT_FORMAT_ERROR(fmt, ...)
 
#define LOGIT_PRINT_ERROR(...)
 
#define LOGIT_PRINTF_ERROR(fmt, ...)
 
#define LOGIT_ERROR_TO(index, ...)
 
#define LOGIT_ERROR0_TO(index)
 
#define LOGIT_0ERROR_TO(index)
 
#define LOGIT_0_ERROR_TO(index)
 
#define LOGIT_NOARGS_ERROR_TO(index)
 
#define LOGIT_FORMAT_ERROR_TO(index, fmt, ...)
 
#define LOGIT_PRINT_ERROR_TO(index, ...)
 
#define LOGIT_PRINTF_ERROR_TO(index, fmt, ...)
 
#define LOGIT_FATAL(...)
 
#define LOGIT_FATAL0()
 
#define LOGIT_0FATAL()
 
#define LOGIT_0_FATAL()
 
#define LOGIT_NOARGS_FATAL()
 
#define LOGIT_FORMAT_FATAL(fmt, ...)
 
#define LOGIT_PRINT_FATAL(...)
 
#define LOGIT_PRINTF_FATAL(fmt, ...)
 
#define LOGIT_FATAL_TO(index, ...)
 
#define LOGIT_FATAL0_TO(index)
 
#define LOGIT_0FATAL_TO(index)
 
#define LOGIT_0_FATAL_TO(index)
 
#define LOGIT_NOARGS_FATAL_TO(index)
 
#define LOGIT_FORMAT_FATAL_TO(index, fmt, ...)
 
#define LOGIT_PRINT_FATAL_TO(index, ...)
 
#define LOGIT_PRINTF_FATAL_TO(index, fmt, ...)
 
#define LOGIT_ADD_LOGGER(logger_type, logger_args, formatter_type, formatter_args)
 Macro for adding a logger with a specific formatter.
 
#define LOGIT_ADD_LOGGER_SINGLE_MODE(logger_type, logger_args, formatter_type, formatter_args)
 Macro for adding a logger with a specific formatter in single_mode.
 
#define LOGIT_ADD_CONSOLE(pattern, async)
 Macro for adding a console logger with a specific pattern and mode.
 
#define LOGIT_ADD_CONSOLE_SINGLE_MODE(pattern, async)
 Macro for adding a console logger in single_mode with a specific pattern and mode.
 
#define LOGIT_ADD_CONSOLE_DEFAULT()
 Macro for adding the default console logger.
 
#define LOGIT_ADD_CONSOLE_DEFAULT_SINGLE_MODE()
 Macro for adding the default console logger in single_mode.
 
#define LOGIT_ADD_FILE_LOGGER(directory, async, auto_delete_days, pattern)
 Macro for adding a file logger with specific settings.
 
#define LOGIT_ADD_FILE_LOGGER_SINGLE_MODE(directory, async, auto_delete_days, pattern)
 Macro for adding a file logger in single_mode with specific settings.
 
#define LOGIT_ADD_FILE_LOGGER_DEFAULT()
 Macro for adding the default file logger.
 
#define LOGIT_ADD_FILE_LOGGER_DEFAULT_SINGLE_MODE()
 Macro for adding the default file logger in single_mode.
 
#define LOGIT_ADD_UNIQUE_FILE_LOGGER(directory, async, auto_delete_days, hash_length, pattern)
 Macro for adding a unique file logger with custom parameters.
 
#define LOGIT_ADD_UNIQUE_FILE_LOGGER_SINGLE_MODE(directory, async, auto_delete_days, hash_length, pattern)
 Macro for adding a unique file logger in single_mode with custom parameters.
 
#define LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT()
 Macro for adding the default unique file logger.
 
#define LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT_SINGLE_MODE()
 Macro for adding the default unique file logger in single_mode.
 
#define LOGIT_WAIT()
 Macro for waiting for all asynchronous loggers to finish processing.
 
#define LOGIT_SHUTDOWN()
 Macro for shutting down logger system.
 
#define LOGIT_FUNCTION   __func__
 
#define LOGIT_ENUM_TO_STR_CASE(value)
 Expands to a case statement returning the stringified enum value.
 
Stream-Based Logging

Macros for logging using a stream-like syntax.

#define LOGIT_STREAM(level)
 Begin a log stream for the specified log level.
 
#define LOGIT_STREAM_WITH_INDEX(level, index)
 Begin a log stream for the specified log level, targeting a specific logger.
 
#define LOGIT_STREAM_TRACE()
 
#define LOGIT_STREAM_DEBUG()
 
#define LOGIT_STREAM_INFO()
 
#define LOGIT_STREAM_WARN()
 
#define LOGIT_STREAM_ERROR()
 
#define LOGIT_STREAM_FATAL()
 
#define LOGIT_STREAM_TRACE_TO(index)
 
#define LOGIT_STREAM_DEBUG_TO(index)
 
#define LOGIT_STREAM_INFO_TO(index)
 
#define LOGIT_STREAM_WARN_TO(index)
 
#define LOGIT_STREAM_ERROR_TO(index)
 
#define LOGIT_STREAM_FATAL_TO(index)
 
Conditional Logging

Macros for logging based on conditions.

#define LOGIT_TRACE_IF(condition, ...)
 
#define LOGIT_TRACE0_IF(condition)
 
#define LOGIT_0TRACE_IF(condition)
 
#define LOGIT_0_TRACE_IF(condition)
 
#define LOGIT_NOARGS_TRACE_IF(condition)
 
#define LOGIT_FORMAT_TRACE_IF(condition, fmt, ...)
 
#define LOGIT_PRINT_TRACE_IF(condition, fmt)
 
#define LOGIT_PRINTF_TRACE_IF(condition, fmt, ...)
 
#define LOGIT_INFO_IF(condition, ...)
 
#define LOGIT_INFO0_IF(condition)
 
#define LOGIT_0INFO_IF(condition)
 
#define LOGIT_0_INFO_IF(condition)
 
#define LOGIT_NOARGS_INFO_IF(condition)
 
#define LOGIT_FORMAT_INFO_IF(condition, fmt, ...)
 
#define LOGIT_PRINT_INFO_IF(condition, fmt)
 
#define LOGIT_PRINTF_INFO_IF(condition, fmt, ...)
 
#define LOGIT_DEBUG_IF(condition, ...)
 
#define LOGIT_DEBUG0_IF(condition)
 
#define LOGIT_0DEBUG_IF(condition)
 
#define LOGIT_0_DEBUG_IF(condition)
 
#define LOGIT_NOARGS_DEBUG_IF(condition)
 
#define LOGIT_FORMAT_DEBUG_IF(condition, fmt, ...)
 
#define LOGIT_PRINT_DEBUG_IF(condition, fmt)
 
#define LOGIT_PRINTF_DEBUG_IF(condition, fmt, ...)
 
#define LOGIT_WARN_IF(condition, ...)
 
#define LOGIT_WARN0_IF(condition)
 
#define LOGIT_0WARN_IF(condition)
 
#define LOGIT_0_WARN_IF(condition)
 
#define LOGIT_NOARGS_WARN_IF(condition)
 
#define LOGIT_FORMAT_WARN_IF(condition, fmt, ...)
 
#define LOGIT_PRINT_WARN_IF(condition, fmt)
 
#define LOGIT_PRINTF_WARN_IF(condition, fmt, ...)
 
#define LOGIT_ERROR_IF(condition, ...)
 
#define LOGIT_ERROR0_IF(condition)
 
#define LOGIT_0ERROR_IF(condition)
 
#define LOGIT_0_ERROR_IF(condition)
 
#define LOGIT_NOARGS_ERROR_IF(condition)
 
#define LOGIT_FORMAT_ERROR_IF(condition, fmt, ...)
 
#define LOGIT_PRINT_ERROR_IF(condition, fmt)
 
#define LOGIT_PRINTF_ERROR_IF(condition, fmt, ...)
 
#define LOGIT_FATAL_IF(condition, ...)
 
#define LOGIT_FATAL0_IF(condition)
 
#define LOGIT_0FATAL_IF(condition)
 
#define LOGIT_0_FATAL_IF(condition)
 
#define LOGIT_NOARGS_FATAL_IF(condition)
 
#define LOGIT_FORMAT_FATAL_IF(condition, fmt, ...)
 
#define LOGIT_PRINT_FATAL_IF(condition, fmt)
 
#define LOGIT_PRINTF_FATAL_IF(condition, fmt, ...)
 
Logger Management

Macros for managing loggers.

#define LOGIT_GET_STRING_PARAM(logger_index, param)
 Retrieves string parameter from a logger.
 
#define LOGIT_GET_INT_PARAM(logger_index, param)
 Retrieves integer parameter from a logger.
 
#define LOGIT_GET_FLOAT_PARAM(logger_index, param)
 Retrieves floating-point parameter from a logger.
 
#define LOGIT_GET_LAST_FILE_NAME(logger_index)
 Retrieves last log file name from a specific logger.
 
#define LOGIT_GET_LAST_FILE_PATH(logger_index)
 Retrieves last log file path from a specific logger.
 
#define LOGIT_GET_LAST_LOG_TIMESTAMP(logger_index)
 Retrieves timestamp of last log from a specific logger.
 
#define LOGIT_GET_TIME_SINCE_LAST_LOG(logger_index)
 Retrieves time since last log from a specific logger.
 
#define LOGIT_SET_LOGGER_ENABLED(logger_index, enabled)
 Enables or disables a logger.
 
#define LOGIT_IS_LOGGER_ENABLED(logger_index)
 Checks if a logger is enabled.
 
#define LOGIT_SET_SINGLE_MODE(logger_index, single_mode)
 Sets single mode for a specific logger.
 
#define LOGIT_SET_TIME_OFFSET(logger_index, offset_ms)
 Sets timestamp offset for a specific logger.
 
#define LOGIT_SET_LOG_LEVEL_TO(logger_index, level)
 Sets minimal log level for a specific logger.
 
#define LOGIT_SET_LOG_LEVEL(level)
 Sets minimal log level for all loggers.
 
#define LOGIT_IS_SINGLE_MODE(logger_index)
 Checks if a logger is in single mode.
 

Detailed Description

Provides various logging macros for different log levels and options.

Definition in file LogMacros.hpp.

Macro Definition Documentation

◆ _LOGIT_LOG_MACROS_HPP_INCLUDED

#define _LOGIT_LOG_MACROS_HPP_INCLUDED

Definition at line 3 of file LogMacros.hpp.

◆ LOGIT_0_DEBUG

#define LOGIT_0_DEBUG ( )
Value:
#define LOGIT_LOG_AND_RETURN_NOARGS(level, format)
Logs a message without arguments.
Definition LogMacros.hpp:81
@ LOG_LVL_DEBUG
Debug level logging.
Definition enums.hpp:17

Definition at line 193 of file LogMacros.hpp.

◆ LOGIT_0_DEBUG_IF

#define LOGIT_0_DEBUG_IF ( condition)
Value:

Definition at line 300 of file LogMacros.hpp.

◆ LOGIT_0_DEBUG_TO

#define LOGIT_0_DEBUG_TO ( index)
Value:
#define LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(level, index, format)
Logs a message to a specific logger without arguments.
Definition LogMacros.hpp:91

Definition at line 203 of file LogMacros.hpp.

◆ LOGIT_0_ERROR

#define LOGIT_0_ERROR ( )
Value:

Definition at line 233 of file LogMacros.hpp.

◆ LOGIT_0_ERROR_IF

#define LOGIT_0_ERROR_IF ( condition)
Value:

Definition at line 320 of file LogMacros.hpp.

◆ LOGIT_0_ERROR_TO

#define LOGIT_0_ERROR_TO ( index)

◆ LOGIT_0_FATAL

#define LOGIT_0_FATAL ( )
Value:

Definition at line 253 of file LogMacros.hpp.

◆ LOGIT_0_FATAL_IF

#define LOGIT_0_FATAL_IF ( condition)
Value:

Definition at line 330 of file LogMacros.hpp.

◆ LOGIT_0_FATAL_TO

#define LOGIT_0_FATAL_TO ( index)

◆ LOGIT_0_INFO

#define LOGIT_0_INFO ( )
Value:

Definition at line 173 of file LogMacros.hpp.

◆ LOGIT_0_INFO_IF

#define LOGIT_0_INFO_IF ( condition)
Value:

Definition at line 290 of file LogMacros.hpp.

◆ LOGIT_0_INFO_TO

#define LOGIT_0_INFO_TO ( index)

◆ LOGIT_0_TRACE

#define LOGIT_0_TRACE ( )
Value:

Definition at line 153 of file LogMacros.hpp.

◆ LOGIT_0_TRACE_IF

#define LOGIT_0_TRACE_IF ( condition)
Value:

Definition at line 280 of file LogMacros.hpp.

◆ LOGIT_0_TRACE_TO

#define LOGIT_0_TRACE_TO ( index)

◆ LOGIT_0_WARN

#define LOGIT_0_WARN ( )
Value:

Definition at line 213 of file LogMacros.hpp.

◆ LOGIT_0_WARN_IF

#define LOGIT_0_WARN_IF ( condition)
Value:

Definition at line 310 of file LogMacros.hpp.

◆ LOGIT_0_WARN_TO

#define LOGIT_0_WARN_TO ( index)

◆ LOGIT_0DEBUG

#define LOGIT_0DEBUG ( )

◆ LOGIT_0DEBUG_IF

#define LOGIT_0DEBUG_IF ( condition)
Value:

Definition at line 299 of file LogMacros.hpp.

◆ LOGIT_0DEBUG_TO

#define LOGIT_0DEBUG_TO ( index)

◆ LOGIT_0ERROR

#define LOGIT_0ERROR ( )

◆ LOGIT_0ERROR_IF

#define LOGIT_0ERROR_IF ( condition)
Value:

Definition at line 319 of file LogMacros.hpp.

◆ LOGIT_0ERROR_TO

#define LOGIT_0ERROR_TO ( index)

◆ LOGIT_0FATAL

#define LOGIT_0FATAL ( )

◆ LOGIT_0FATAL_IF

#define LOGIT_0FATAL_IF ( condition)
Value:

Definition at line 329 of file LogMacros.hpp.

◆ LOGIT_0FATAL_TO

#define LOGIT_0FATAL_TO ( index)

◆ LOGIT_0INFO

#define LOGIT_0INFO ( )

◆ LOGIT_0INFO_IF

#define LOGIT_0INFO_IF ( condition)
Value:

Definition at line 289 of file LogMacros.hpp.

◆ LOGIT_0INFO_TO

#define LOGIT_0INFO_TO ( index)

◆ LOGIT_0TRACE

#define LOGIT_0TRACE ( )

◆ LOGIT_0TRACE_IF

#define LOGIT_0TRACE_IF ( condition)
Value:

Definition at line 279 of file LogMacros.hpp.

◆ LOGIT_0TRACE_TO

#define LOGIT_0TRACE_TO ( index)

◆ LOGIT_0WARN

#define LOGIT_0WARN ( )

◆ LOGIT_0WARN_IF

#define LOGIT_0WARN_IF ( condition)
Value:

Definition at line 309 of file LogMacros.hpp.

◆ LOGIT_0WARN_TO

#define LOGIT_0WARN_TO ( index)

◆ LOGIT_ADD_CONSOLE

#define LOGIT_ADD_CONSOLE ( pattern,
async )
Value:
std::unique_ptr<logit::ConsoleLogger>(new logit::ConsoleLogger(async)), \
std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)), \
false)
Outputs log messages to the console with optional ANSI color support.
void add_logger(std::unique_ptr< ILogger > logger, std::unique_ptr< ILogFormatter > formatter, bool single_mode=false)
Adds a logger and its corresponding formatter.
Definition Logger.hpp:39
static Logger & get_instance()
Retrieves singleton instance of Logger.
Definition Logger.hpp:28
A simple log formatter that formats log messages based on a user-defined pattern.

Macro for adding a console logger with a specific pattern and mode.

Parameters
patternThe format pattern for log messages.
asyncBoolean indicating whether logging should be asynchronous (true) or synchronous (false). This version uses new and std::unique_ptr for C++11 compatibility.

Definition at line 728 of file LogMacros.hpp.

◆ LOGIT_ADD_CONSOLE_DEFAULT

#define LOGIT_ADD_CONSOLE_DEFAULT ( )
Value:
std::unique_ptr<logit::ConsoleLogger>(new logit::ConsoleLogger(true)), \
std::unique_ptr<logit::SimpleLogFormatter>( \
false)
#define LOGIT_CONSOLE_PATTERN
Defines the default log pattern for the console logger.

Macro for adding the default console logger.

This logger uses the default format pattern and asynchronous logging. This version uses new and std::unique_ptr for C++11 compatibility.

Definition at line 748 of file LogMacros.hpp.

◆ LOGIT_ADD_CONSOLE_DEFAULT_SINGLE_MODE

#define LOGIT_ADD_CONSOLE_DEFAULT_SINGLE_MODE ( )
Value:
std::unique_ptr<logit::ConsoleLogger>(new logit::ConsoleLogger(true)), \
std::unique_ptr<logit::SimpleLogFormatter>( \
true)

Macro for adding the default console logger in single_mode.

In single_mode, the console logger can only be invoked using macros like LOGIT_TRACE_TO. This version uses new and std::unique_ptr for C++11 compatibility.

Definition at line 758 of file LogMacros.hpp.

◆ LOGIT_ADD_CONSOLE_SINGLE_MODE

#define LOGIT_ADD_CONSOLE_SINGLE_MODE ( pattern,
async )
Value:
std::unique_ptr<logit::ConsoleLogger>(new logit::ConsoleLogger(async)), \
std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)), \
true)

Macro for adding a console logger in single_mode with a specific pattern and mode.

Parameters
patternThe format pattern for log messages.
asyncBoolean indicating whether logging should be asynchronous (true) or synchronous (false). In single_mode, the console logger can only be invoked using macros like LOGIT_TRACE_TO. This version uses new and std::unique_ptr for C++11 compatibility.

Definition at line 739 of file LogMacros.hpp.

◆ LOGIT_ADD_FILE_LOGGER

#define LOGIT_ADD_FILE_LOGGER ( directory,
async,
auto_delete_days,
pattern )
Value:
std::unique_ptr<logit::FileLogger>(new logit::FileLogger( \
directory, async, auto_delete_days)), \
std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)))
Logs messages to files with date-based rotation and automatic deletion of old logs.

Macro for adding a file logger with specific settings.

Parameters
directoryThe directory where log files will be stored.
asyncBoolean indicating whether logging should be asynchronous (true) or synchronous (false).
auto_delete_daysNumber of days after which old log files are deleted.
patternThe format pattern for log messages. This version uses new and std::unique_ptr for C++11 compatibility.

Definition at line 771 of file LogMacros.hpp.

◆ LOGIT_ADD_FILE_LOGGER_DEFAULT

#define LOGIT_ADD_FILE_LOGGER_DEFAULT ( )
Value:
std::unique_ptr<logit::FileLogger>(new logit::FileLogger( \
std::unique_ptr<logit::SimpleLogFormatter>( \
#define LOGIT_FILE_LOGGER_PATH
Defines the default directory path for log files.
#define LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS
Defines the number of days after which old log files are deleted.
#define LOGIT_FILE_LOGGER_PATTERN
Defines the default log pattern for file-based loggers.

Macro for adding the default file logger.

This logger writes logs to the default file path and deletes logs older than the default number of days. This version uses new and std::unique_ptr for C++11 compatibility.

Definition at line 794 of file LogMacros.hpp.

◆ LOGIT_ADD_FILE_LOGGER_DEFAULT_SINGLE_MODE

#define LOGIT_ADD_FILE_LOGGER_DEFAULT_SINGLE_MODE ( )
Value:
std::unique_ptr<logit::FileLogger>(new logit::FileLogger( \
std::unique_ptr<logit::SimpleLogFormatter>( \
true)

Macro for adding the default file logger in single_mode.

In single_mode, the file logger can only be invoked using macros like LOGIT_TRACE_TO. This version uses new and std::unique_ptr for C++11 compatibility.

Definition at line 805 of file LogMacros.hpp.

◆ LOGIT_ADD_FILE_LOGGER_SINGLE_MODE

#define LOGIT_ADD_FILE_LOGGER_SINGLE_MODE ( directory,
async,
auto_delete_days,
pattern )
Value:
std::unique_ptr<logit::FileLogger>(new logit::FileLogger( \
directory, async, auto_delete_days)), \
std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)), \
true)

Macro for adding a file logger in single_mode with specific settings.

Parameters
directoryThe directory where log files will be stored.
asyncBoolean indicating whether logging should be asynchronous (true) or synchronous (false).
auto_delete_daysNumber of days after which old log files are deleted.
patternThe format pattern for log messages. In single_mode, the file logger can only be invoked using macros like LOGIT_TRACE_TO. This version uses new and std::unique_ptr for C++11 compatibility.

Definition at line 784 of file LogMacros.hpp.

◆ LOGIT_ADD_LOGGER

#define LOGIT_ADD_LOGGER ( logger_type,
logger_args,
formatter_type,
formatter_args )
Value:
std::unique_ptr<logger_type>(new logger_type logger_args), \
std::unique_ptr<formatter_type>(new formatter_type formatter_args), \
false)

Macro for adding a logger with a specific formatter.

Parameters
logger_typeThe type of logger (e.g., ConsoleLogger).
logger_argsArguments for the logger constructor, enclosed in parentheses.
formatter_typeThe type of formatter (e.g., SimpleLogFormatter).
formatter_argsArguments for the formatter constructor, enclosed in parentheses. This version uses new and std::unique_ptr for C++11 compatibility.

Definition at line 705 of file LogMacros.hpp.

◆ LOGIT_ADD_LOGGER_SINGLE_MODE

#define LOGIT_ADD_LOGGER_SINGLE_MODE ( logger_type,
logger_args,
formatter_type,
formatter_args )
Value:
std::unique_ptr<logger_type>(new logger_type logger_args), \
std::unique_ptr<formatter_type>(new formatter_type formatter_args), \
true)

Macro for adding a logger with a specific formatter in single_mode.

Parameters
logger_typeThe type of logger (e.g., ConsoleLogger).
logger_argsArguments for the logger constructor, enclosed in parentheses.
formatter_typeThe type of formatter (e.g., SimpleLogFormatter).
formatter_argsArguments for the formatter constructor, enclosed in parentheses. In single_mode, loggers can only be invoked explicitly using macros like LOGIT_TRACE_TO. This version uses new and std::unique_ptr for C++11 compatibility.

Definition at line 718 of file LogMacros.hpp.

◆ LOGIT_ADD_UNIQUE_FILE_LOGGER

#define LOGIT_ADD_UNIQUE_FILE_LOGGER ( directory,
async,
auto_delete_days,
hash_length,
pattern )
Value:
std::unique_ptr<logit::UniqueFileLogger>(new logit::UniqueFileLogger( \
directory, async, auto_delete_days, hash_length)), \
std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)))
Writes each log message to a unique file with automatic cleanup.

Macro for adding a unique file logger with custom parameters.

Parameters
directoryThe directory where log files will be stored.
asyncBoolean indicating whether logging should be asynchronous (true) or synchronous (false).
auto_delete_daysNumber of days after which old log files are deleted.
hash_lengthThe length of the hash to be appended to the log file name.
patternThe format pattern for log messages. This version uses new and std::unique_ptr for C++11 compatibility.

Definition at line 821 of file LogMacros.hpp.

◆ LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT

#define LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT ( )
Value:
std::unique_ptr<logit::UniqueFileLogger>(new logit::UniqueFileLogger( \
std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(LOGIT_UNIQUE_FILE_LOGGER_PATTERN)))
#define LOGIT_UNIQUE_FILE_LOGGER_PATTERN
Defines the default log pattern for unique file-based loggers.
#define LOGIT_UNIQUE_FILE_LOGGER_PATH
Defines the default directory path for unique log files.

Macro for adding the default unique file logger.

This macro adds a UniqueFileLogger with default settings, which writes each log message to a new file. Log files are stored in the directory specified by LOGIT_UNIQUE_FILE_LOGGER_PATH, using asynchronous mode and auto-deleting logs older than the number of days specified by LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS. This version uses new and std::unique_ptr for C++11 compatibility.

Definition at line 847 of file LogMacros.hpp.

◆ LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT_SINGLE_MODE

#define LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT_SINGLE_MODE ( )
Value:
std::unique_ptr<logit::UniqueFileLogger>(new logit::UniqueFileLogger( \
std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(LOGIT_UNIQUE_FILE_LOGGER_PATTERN)), \
true)

Macro for adding the default unique file logger in single_mode.

This macro adds a UniqueFileLogger with default settings, which writes each log message to a new file. Log files are stored in the directory specified by LOGIT_UNIQUE_FILE_LOGGER_PATH, using asynchronous mode and auto-deleting logs older than the number of days specified by LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS. In single_mode, the unique file logger can only be invoked using macros like LOGIT_TRACE_TO. This version uses new and std::unique_ptr for C++11 compatibility.

Definition at line 860 of file LogMacros.hpp.

◆ LOGIT_ADD_UNIQUE_FILE_LOGGER_SINGLE_MODE

#define LOGIT_ADD_UNIQUE_FILE_LOGGER_SINGLE_MODE ( directory,
async,
auto_delete_days,
hash_length,
pattern )
Value:
std::unique_ptr<logit::UniqueFileLogger>(new logit::UniqueFileLogger( \
directory, async, auto_delete_days, hash_length)), \
std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)), \
true)

Macro for adding a unique file logger in single_mode with custom parameters.

Parameters
directoryThe directory where log files will be stored.
asyncBoolean indicating whether logging should be asynchronous (true) or synchronous (false).
auto_delete_daysNumber of days after which old log files are deleted.
hash_lengthThe length of the hash to be appended to the log file name.
patternThe format pattern for log messages. In single_mode, the unique file logger can only be invoked using macros like LOGIT_TRACE_TO. This version uses new and std::unique_ptr for C++11 compatibility.

Definition at line 835 of file LogMacros.hpp.

◆ LOGIT_DEBUG

#define LOGIT_DEBUG ( ...)
Value:
#define LOGIT_LOG_AND_RETURN(level, format, arg_names,...)
Logs a message with arguments.

Definition at line 190 of file LogMacros.hpp.

◆ LOGIT_DEBUG0

#define LOGIT_DEBUG0 ( )

◆ LOGIT_DEBUG0_IF

#define LOGIT_DEBUG0_IF ( condition)
Value:

Definition at line 298 of file LogMacros.hpp.

◆ LOGIT_DEBUG0_TO

#define LOGIT_DEBUG0_TO ( index)

◆ LOGIT_DEBUG_IF

#define LOGIT_DEBUG_IF ( condition,
... )
Value:
if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_DEBUG, {}, #__VA_ARGS__, __VA_ARGS__)

Definition at line 297 of file LogMacros.hpp.

◆ LOGIT_DEBUG_TO

#define LOGIT_DEBUG_TO ( index,
... )
Value:
#define LOGIT_LOG_AND_RETURN_WITH_INDEX(level, index, format, arg_names,...)
Logs a message with arguments to a specific logger.

Definition at line 200 of file LogMacros.hpp.

◆ LOGIT_ERROR

#define LOGIT_ERROR ( ...)
Value:

Definition at line 230 of file LogMacros.hpp.

◆ LOGIT_ERROR0

#define LOGIT_ERROR0 ( )

◆ LOGIT_ERROR0_IF

#define LOGIT_ERROR0_IF ( condition)
Value:

Definition at line 318 of file LogMacros.hpp.

◆ LOGIT_ERROR0_TO

#define LOGIT_ERROR0_TO ( index)

◆ LOGIT_ERROR_IF

#define LOGIT_ERROR_IF ( condition,
... )
Value:
if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_ERROR, {}, #__VA_ARGS__, __VA_ARGS__)

Definition at line 317 of file LogMacros.hpp.

◆ LOGIT_ERROR_TO

#define LOGIT_ERROR_TO ( index,
... )
Value:

Definition at line 240 of file LogMacros.hpp.

◆ LOGIT_FATAL

#define LOGIT_FATAL ( ...)
Value:

Definition at line 250 of file LogMacros.hpp.

◆ LOGIT_FATAL0

#define LOGIT_FATAL0 ( )

◆ LOGIT_FATAL0_IF

#define LOGIT_FATAL0_IF ( condition)
Value:

Definition at line 328 of file LogMacros.hpp.

◆ LOGIT_FATAL0_TO

#define LOGIT_FATAL0_TO ( index)

◆ LOGIT_FATAL_IF

#define LOGIT_FATAL_IF ( condition,
... )
Value:
if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_FATAL, {}, #__VA_ARGS__, __VA_ARGS__)

Definition at line 327 of file LogMacros.hpp.

◆ LOGIT_FATAL_TO

#define LOGIT_FATAL_TO ( index,
... )
Value:

Definition at line 260 of file LogMacros.hpp.

◆ LOGIT_FORMAT_DEBUG

#define LOGIT_FORMAT_DEBUG ( fmt,
... )
Value:
LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_DEBUG, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 195 of file LogMacros.hpp.

◆ LOGIT_FORMAT_DEBUG_IF

#define LOGIT_FORMAT_DEBUG_IF ( condition,
fmt,
... )
Value:
if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_DEBUG, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 302 of file LogMacros.hpp.

◆ LOGIT_FORMAT_DEBUG_TO

#define LOGIT_FORMAT_DEBUG_TO ( index,
fmt,
... )
Value:
LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 205 of file LogMacros.hpp.

◆ LOGIT_FORMAT_ERROR

#define LOGIT_FORMAT_ERROR ( fmt,
... )
Value:
LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_ERROR, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 235 of file LogMacros.hpp.

◆ LOGIT_FORMAT_ERROR_IF

#define LOGIT_FORMAT_ERROR_IF ( condition,
fmt,
... )
Value:
if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_ERROR, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 322 of file LogMacros.hpp.

◆ LOGIT_FORMAT_ERROR_TO

#define LOGIT_FORMAT_ERROR_TO ( index,
fmt,
... )
Value:
LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 245 of file LogMacros.hpp.

◆ LOGIT_FORMAT_FATAL

#define LOGIT_FORMAT_FATAL ( fmt,
... )
Value:
LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_FATAL, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 255 of file LogMacros.hpp.

◆ LOGIT_FORMAT_FATAL_IF

#define LOGIT_FORMAT_FATAL_IF ( condition,
fmt,
... )
Value:
if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_FATAL, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 332 of file LogMacros.hpp.

◆ LOGIT_FORMAT_FATAL_TO

#define LOGIT_FORMAT_FATAL_TO ( index,
fmt,
... )
Value:
LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 265 of file LogMacros.hpp.

◆ LOGIT_FORMAT_INFO

#define LOGIT_FORMAT_INFO ( fmt,
... )
Value:
LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_INFO, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 175 of file LogMacros.hpp.

◆ LOGIT_FORMAT_INFO_IF

#define LOGIT_FORMAT_INFO_IF ( condition,
fmt,
... )
Value:
if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_INFO, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 292 of file LogMacros.hpp.

◆ LOGIT_FORMAT_INFO_TO

#define LOGIT_FORMAT_INFO_TO ( index,
fmt,
... )
Value:
LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 185 of file LogMacros.hpp.

◆ LOGIT_FORMAT_TRACE

#define LOGIT_FORMAT_TRACE ( fmt,
... )
Value:
LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_TRACE, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 155 of file LogMacros.hpp.

◆ LOGIT_FORMAT_TRACE_IF

#define LOGIT_FORMAT_TRACE_IF ( condition,
fmt,
... )
Value:
if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_TRACE, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 282 of file LogMacros.hpp.

◆ LOGIT_FORMAT_TRACE_TO

#define LOGIT_FORMAT_TRACE_TO ( index,
fmt,
... )
Value:
LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 165 of file LogMacros.hpp.

◆ LOGIT_FORMAT_WARN

#define LOGIT_FORMAT_WARN ( fmt,
... )
Value:
LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_WARN, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 215 of file LogMacros.hpp.

◆ LOGIT_FORMAT_WARN_IF

#define LOGIT_FORMAT_WARN_IF ( condition,
fmt,
... )
Value:
if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_WARN, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 312 of file LogMacros.hpp.

◆ LOGIT_FORMAT_WARN_TO

#define LOGIT_FORMAT_WARN_TO ( index,
fmt,
... )
Value:
LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, fmt, #__VA_ARGS__, __VA_ARGS__)

Definition at line 225 of file LogMacros.hpp.

◆ LOGIT_GET_FLOAT_PARAM

#define LOGIT_GET_FLOAT_PARAM ( logger_index,
param )
Value:
double get_float_param(int logger_index, const LoggerParam &param) const
Retrieves a floating-point parameter from a logger.
Definition Logger.hpp:184

Retrieves floating-point parameter from a logger.

Parameters
logger_indexIndex of logger.
paramParameter to retrieve.
Returns
Requested parameter as a double.

Definition at line 892 of file LogMacros.hpp.

◆ LOGIT_GET_INT_PARAM

#define LOGIT_GET_INT_PARAM ( logger_index,
param )
Value:
int64_t get_int_param(int logger_index, const LoggerParam &param) const
Retrieves an integer parameter from a logger.
Definition Logger.hpp:171

Retrieves integer parameter from a logger.

Parameters
logger_indexIndex of logger.
paramParameter to retrieve.
Returns
Requested parameter as an integer.

Definition at line 885 of file LogMacros.hpp.

◆ LOGIT_GET_LAST_FILE_NAME

#define LOGIT_GET_LAST_FILE_NAME ( logger_index)
Value:
std::string get_string_param(int logger_index, const LoggerParam &param) const
Retrieves a string parameter from a logger.
Definition Logger.hpp:158
@ LastFileName
The name of the last file written to.
Definition enums.hpp:48

Retrieves last log file name from a specific logger.

Parameters
logger_indexIndex of logger.
Returns
Last file name written to.

Definition at line 898 of file LogMacros.hpp.

◆ LOGIT_GET_LAST_FILE_PATH

#define LOGIT_GET_LAST_FILE_PATH ( logger_index)
Value:
@ LastFilePath
The full path of the last file written to.
Definition enums.hpp:49

Retrieves last log file path from a specific logger.

Parameters
logger_indexIndex of logger.
Returns
Full path of last file written to.

Definition at line 904 of file LogMacros.hpp.

◆ LOGIT_GET_LAST_LOG_TIMESTAMP

#define LOGIT_GET_LAST_LOG_TIMESTAMP ( logger_index)
Value:

Retrieves timestamp of last log from a specific logger.

Parameters
logger_indexIndex of logger.
Returns
Timestamp of last log.

Definition at line 910 of file LogMacros.hpp.

◆ LOGIT_GET_STRING_PARAM

#define LOGIT_GET_STRING_PARAM ( logger_index,
param )
Value:

Retrieves string parameter from a logger.

Parameters
logger_indexIndex of logger.
paramParameter to retrieve.
Returns
Requested parameter as a string.

Definition at line 878 of file LogMacros.hpp.

◆ LOGIT_GET_TIME_SINCE_LAST_LOG

#define LOGIT_GET_TIME_SINCE_LAST_LOG ( logger_index)
Value:
@ TimeSinceLastLog
The time elapsed since the last log in seconds.
Definition enums.hpp:51

Retrieves time since last log from a specific logger.

Parameters
logger_indexIndex of logger.
Returns
Time elapsed since last log in seconds.

Definition at line 916 of file LogMacros.hpp.

◆ LOGIT_INFO

#define LOGIT_INFO ( ...)
Value:
LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_INFO, {}, #__VA_ARGS__, __VA_ARGS__)

Definition at line 170 of file LogMacros.hpp.

◆ LOGIT_INFO0

#define LOGIT_INFO0 ( )

◆ LOGIT_INFO0_IF

#define LOGIT_INFO0_IF ( condition)
Value:

Definition at line 288 of file LogMacros.hpp.

◆ LOGIT_INFO0_TO

#define LOGIT_INFO0_TO ( index)

◆ LOGIT_INFO_IF

#define LOGIT_INFO_IF ( condition,
... )
Value:
if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_INFO, {}, #__VA_ARGS__, __VA_ARGS__)

Definition at line 287 of file LogMacros.hpp.

◆ LOGIT_INFO_TO

#define LOGIT_INFO_TO ( index,
... )
Value:
LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, {}, #__VA_ARGS__, __VA_ARGS__)

Definition at line 180 of file LogMacros.hpp.

◆ LOGIT_IS_LOGGER_ENABLED

#define LOGIT_IS_LOGGER_ENABLED ( logger_index)
Value:
bool is_logger_enabled(int logger_index) const
Checks if a logger is enabled.
Definition Logger.hpp:67

Checks if a logger is enabled.

Parameters
logger_indexIndex of logger.
Returns
True if enabled, false otherwise.

Definition at line 928 of file LogMacros.hpp.

◆ LOGIT_IS_SINGLE_MODE

#define LOGIT_IS_SINGLE_MODE ( logger_index)
Value:
bool is_logger_single_mode(int logger_index) const
Checks whether a logger is in single mode.
Definition Logger.hpp:121

Checks if a logger is in single mode.

Parameters
logger_indexIndex of logger.
Returns
True if in single mode, false otherwise.

Definition at line 957 of file LogMacros.hpp.

◆ LOGIT_LOG_AND_RETURN

#define LOGIT_LOG_AND_RETURN ( level,
format,
arg_names,
... )
Value:
logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
LOGIT_FUNCTION, format, arg_names, -1, false}, __VA_ARGS__)
#define LOGIT_CURRENT_TIMESTAMP_MS()
Macro to get the current timestamp in milliseconds.
auto log_and_return(const LogRecord &record, Ts &&... args) -> decltype(std::forward_as_tuple(std::forward< Ts >(args)...))
Logs message and returns tuple of arguments.
Definition Logger.hpp:199
#define LOGIT_BASE_PATH
Defines the base path used for log file paths.
#define LOGIT_FUNCTION
Definition LogMacros.hpp:18
Stores log metadata and content.
Definition LogRecord.hpp:14

Logs a message with arguments.

Parameters
levelThe log level.
formatThe log message format.
arg_namesThe names of the arguments.
...The arguments to log.

Definition at line 105 of file LogMacros.hpp.

◆ LOGIT_LOG_AND_RETURN_NOARGS

#define LOGIT_LOG_AND_RETURN_NOARGS ( level,
format )
Value:
logit::make_relative(__FILE__, LOGIT_BASE_PATH), \
__LINE__, LOGIT_FUNCTION, format, {}, -1, false})

Logs a message without arguments.

Parameters
levelThe log level.
formatThe log message format.

Definition at line 81 of file LogMacros.hpp.

◆ LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX

#define LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX ( level,
index,
format )
Value:
logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
LOGIT_FUNCTION, format, {}, index})

Logs a message to a specific logger without arguments.

Parameters
levelThe log level.
indexThe index of the logger to log to.
formatThe log message format.

Definition at line 91 of file LogMacros.hpp.

◆ LOGIT_LOG_AND_RETURN_PRINT

#define LOGIT_LOG_AND_RETURN_PRINT ( level,
arg_names,
... )
Value:
logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
LOGIT_FUNCTION, {}, arg_names, -1, true}, __VA_ARGS__)

Logs a message with arguments, but prints them without using a format string.

Parameters
levelThe log level.
arg_namesThe names of the arguments.
...The arguments to log.

This macro logs the raw arguments without applying any formatting to them.

Definition at line 116 of file LogMacros.hpp.

◆ LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX

#define LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX ( level,
index,
arg_names,
... )
Value:
logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
LOGIT_FUNCTION, {}, arg_names, index, true}, __VA_ARGS__)

Logs a message with arguments to a specific logger, but prints them without using a format string.

Parameters
levelThe log level.
indexThe index of the logger to log to.
arg_namesThe names of the arguments.
...The arguments to log.

This macro logs the raw arguments without applying any formatting to them to a specific logger.

Definition at line 140 of file LogMacros.hpp.

◆ LOGIT_LOG_AND_RETURN_WITH_INDEX

#define LOGIT_LOG_AND_RETURN_WITH_INDEX ( level,
index,
format,
arg_names,
... )
Value:
logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
LOGIT_FUNCTION, format, arg_names, index, false}, __VA_ARGS__)

Logs a message with arguments to a specific logger.

Parameters
levelThe log level.
indexThe index of the logger to log to.
formatThe log message format.
arg_namesThe names of the arguments.
...The arguments to log.

Definition at line 128 of file LogMacros.hpp.

◆ LOGIT_NOARGS_DEBUG

#define LOGIT_NOARGS_DEBUG ( )

◆ LOGIT_NOARGS_DEBUG_IF

#define LOGIT_NOARGS_DEBUG_IF ( condition)
Value:

Definition at line 301 of file LogMacros.hpp.

◆ LOGIT_NOARGS_DEBUG_TO

#define LOGIT_NOARGS_DEBUG_TO ( index)

◆ LOGIT_NOARGS_ERROR

#define LOGIT_NOARGS_ERROR ( )

◆ LOGIT_NOARGS_ERROR_IF

#define LOGIT_NOARGS_ERROR_IF ( condition)
Value:

Definition at line 321 of file LogMacros.hpp.

◆ LOGIT_NOARGS_ERROR_TO

#define LOGIT_NOARGS_ERROR_TO ( index)

◆ LOGIT_NOARGS_FATAL

#define LOGIT_NOARGS_FATAL ( )

◆ LOGIT_NOARGS_FATAL_IF

#define LOGIT_NOARGS_FATAL_IF ( condition)
Value:

Definition at line 331 of file LogMacros.hpp.

◆ LOGIT_NOARGS_FATAL_TO

#define LOGIT_NOARGS_FATAL_TO ( index)

◆ LOGIT_NOARGS_INFO

#define LOGIT_NOARGS_INFO ( )

◆ LOGIT_NOARGS_INFO_IF

#define LOGIT_NOARGS_INFO_IF ( condition)
Value:

Definition at line 291 of file LogMacros.hpp.

◆ LOGIT_NOARGS_INFO_TO

#define LOGIT_NOARGS_INFO_TO ( index)

◆ LOGIT_NOARGS_TRACE

#define LOGIT_NOARGS_TRACE ( )

◆ LOGIT_NOARGS_TRACE_IF

#define LOGIT_NOARGS_TRACE_IF ( condition)
Value:

Definition at line 281 of file LogMacros.hpp.

◆ LOGIT_NOARGS_TRACE_TO

#define LOGIT_NOARGS_TRACE_TO ( index)

◆ LOGIT_NOARGS_WARN

#define LOGIT_NOARGS_WARN ( )

◆ LOGIT_NOARGS_WARN_IF

#define LOGIT_NOARGS_WARN_IF ( condition)
Value:

Definition at line 311 of file LogMacros.hpp.

◆ LOGIT_NOARGS_WARN_TO

#define LOGIT_NOARGS_WARN_TO ( index)

◆ LOGIT_PRINT_DEBUG

#define LOGIT_PRINT_DEBUG ( ...)
Value:
#define LOGIT_LOG_AND_RETURN_PRINT(level, arg_names,...)
Logs a message with arguments, but prints them without using a format string.

Definition at line 196 of file LogMacros.hpp.

◆ LOGIT_PRINT_DEBUG_IF

#define LOGIT_PRINT_DEBUG_IF ( condition,
fmt )
Value:

Definition at line 303 of file LogMacros.hpp.

◆ LOGIT_PRINT_DEBUG_TO

#define LOGIT_PRINT_DEBUG_TO ( index,
... )
Value:
#define LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(level, index, arg_names,...)
Logs a message with arguments to a specific logger, but prints them without using a format string.

Definition at line 206 of file LogMacros.hpp.

◆ LOGIT_PRINT_ERROR

#define LOGIT_PRINT_ERROR ( ...)
Value:

Definition at line 236 of file LogMacros.hpp.

◆ LOGIT_PRINT_ERROR_IF

#define LOGIT_PRINT_ERROR_IF ( condition,
fmt )
Value:

Definition at line 323 of file LogMacros.hpp.

◆ LOGIT_PRINT_ERROR_TO

#define LOGIT_PRINT_ERROR_TO ( index,
... )
Value:

Definition at line 246 of file LogMacros.hpp.

◆ LOGIT_PRINT_FATAL

#define LOGIT_PRINT_FATAL ( ...)
Value:

Definition at line 256 of file LogMacros.hpp.

◆ LOGIT_PRINT_FATAL_IF

#define LOGIT_PRINT_FATAL_IF ( condition,
fmt )
Value:

Definition at line 333 of file LogMacros.hpp.

◆ LOGIT_PRINT_FATAL_TO

#define LOGIT_PRINT_FATAL_TO ( index,
... )
Value:

Definition at line 266 of file LogMacros.hpp.

◆ LOGIT_PRINT_INFO

#define LOGIT_PRINT_INFO ( ...)
Value:

Definition at line 176 of file LogMacros.hpp.

◆ LOGIT_PRINT_INFO_IF

#define LOGIT_PRINT_INFO_IF ( condition,
fmt )
Value:

Definition at line 293 of file LogMacros.hpp.

◆ LOGIT_PRINT_INFO_TO

#define LOGIT_PRINT_INFO_TO ( index,
... )
Value:

Definition at line 186 of file LogMacros.hpp.

◆ LOGIT_PRINT_TRACE

#define LOGIT_PRINT_TRACE ( ...)
Value:

Definition at line 156 of file LogMacros.hpp.

◆ LOGIT_PRINT_TRACE_IF

#define LOGIT_PRINT_TRACE_IF ( condition,
fmt )
Value:

Definition at line 283 of file LogMacros.hpp.

◆ LOGIT_PRINT_TRACE_TO

#define LOGIT_PRINT_TRACE_TO ( index,
... )
Value:

Definition at line 166 of file LogMacros.hpp.

◆ LOGIT_PRINT_WARN

#define LOGIT_PRINT_WARN ( ...)
Value:

Definition at line 216 of file LogMacros.hpp.

◆ LOGIT_PRINT_WARN_IF

#define LOGIT_PRINT_WARN_IF ( condition,
fmt )
Value:

Definition at line 313 of file LogMacros.hpp.

◆ LOGIT_PRINT_WARN_TO

#define LOGIT_PRINT_WARN_TO ( index,
... )
Value:

Definition at line 226 of file LogMacros.hpp.

◆ LOGIT_PRINTF_DEBUG

#define LOGIT_PRINTF_DEBUG ( fmt,
... )
Value:
std::string format(const char *fmt,...)
Formats a string according to the specified format.
Definition format.hpp:28

Definition at line 197 of file LogMacros.hpp.

◆ LOGIT_PRINTF_DEBUG_IF

#define LOGIT_PRINTF_DEBUG_IF ( condition,
fmt,
... )
Value:

Definition at line 304 of file LogMacros.hpp.

◆ LOGIT_PRINTF_DEBUG_TO

#define LOGIT_PRINTF_DEBUG_TO ( index,
fmt,
... )
Value:

Definition at line 207 of file LogMacros.hpp.

◆ LOGIT_PRINTF_ERROR

#define LOGIT_PRINTF_ERROR ( fmt,
... )
Value:

Definition at line 237 of file LogMacros.hpp.

◆ LOGIT_PRINTF_ERROR_IF

#define LOGIT_PRINTF_ERROR_IF ( condition,
fmt,
... )
Value:

Definition at line 324 of file LogMacros.hpp.

◆ LOGIT_PRINTF_ERROR_TO

#define LOGIT_PRINTF_ERROR_TO ( index,
fmt,
... )
Value:

Definition at line 247 of file LogMacros.hpp.

◆ LOGIT_PRINTF_FATAL

#define LOGIT_PRINTF_FATAL ( fmt,
... )
Value:

Definition at line 257 of file LogMacros.hpp.

◆ LOGIT_PRINTF_FATAL_IF

#define LOGIT_PRINTF_FATAL_IF ( condition,
fmt,
... )
Value:

Definition at line 334 of file LogMacros.hpp.

◆ LOGIT_PRINTF_FATAL_TO

#define LOGIT_PRINTF_FATAL_TO ( index,
fmt,
... )
Value:

Definition at line 267 of file LogMacros.hpp.

◆ LOGIT_PRINTF_INFO

#define LOGIT_PRINTF_INFO ( fmt,
... )
Value:

Definition at line 177 of file LogMacros.hpp.

◆ LOGIT_PRINTF_INFO_IF

#define LOGIT_PRINTF_INFO_IF ( condition,
fmt,
... )
Value:

Definition at line 294 of file LogMacros.hpp.

◆ LOGIT_PRINTF_INFO_TO

#define LOGIT_PRINTF_INFO_TO ( index,
fmt,
... )
Value:

Definition at line 187 of file LogMacros.hpp.

◆ LOGIT_PRINTF_TRACE

#define LOGIT_PRINTF_TRACE ( fmt,
... )
Value:

Definition at line 157 of file LogMacros.hpp.

◆ LOGIT_PRINTF_TRACE_IF

#define LOGIT_PRINTF_TRACE_IF ( condition,
fmt,
... )
Value:

Definition at line 284 of file LogMacros.hpp.

◆ LOGIT_PRINTF_TRACE_TO

#define LOGIT_PRINTF_TRACE_TO ( index,
fmt,
... )
Value:

Definition at line 167 of file LogMacros.hpp.

◆ LOGIT_PRINTF_WARN

#define LOGIT_PRINTF_WARN ( fmt,
... )
Value:

Definition at line 217 of file LogMacros.hpp.

◆ LOGIT_PRINTF_WARN_IF

#define LOGIT_PRINTF_WARN_IF ( condition,
fmt,
... )
Value:

Definition at line 314 of file LogMacros.hpp.

◆ LOGIT_PRINTF_WARN_TO

#define LOGIT_PRINTF_WARN_TO ( index,
fmt,
... )
Value:

Definition at line 227 of file LogMacros.hpp.

◆ LOGIT_SET_LOG_LEVEL

#define LOGIT_SET_LOG_LEVEL ( level)
Value:
void set_log_level(LogLevel level)
Sets minimal log level for all loggers.
Definition Logger.hpp:99

Sets minimal log level for all loggers.

Parameters
levelMinimum log level.

Definition at line 951 of file LogMacros.hpp.

◆ LOGIT_SET_LOG_LEVEL_TO

#define LOGIT_SET_LOG_LEVEL_TO ( logger_index,
level )
Value:

Sets minimal log level for a specific logger.

Parameters
logger_indexIndex of logger.
levelMinimum log level.

Definition at line 946 of file LogMacros.hpp.

◆ LOGIT_SET_LOGGER_ENABLED

#define LOGIT_SET_LOGGER_ENABLED ( logger_index,
enabled )
Value:
void set_logger_enabled(int logger_index, bool enabled)
Enables or disables a logger by index.
Definition Logger.hpp:56

Enables or disables a logger.

Parameters
logger_indexIndex of logger.
enabledTrue to enable, false to disable.

Definition at line 922 of file LogMacros.hpp.

◆ LOGIT_SET_SINGLE_MODE

#define LOGIT_SET_SINGLE_MODE ( logger_index,
single_mode )
Value:
void set_logger_single_mode(int logger_index, bool single_mode)
Sets single-mode flag for a logger.
Definition Logger.hpp:78

Sets single mode for a specific logger.

Parameters
logger_indexIndex of logger.
single_modeTrue to enable single mode, false otherwise.

Definition at line 934 of file LogMacros.hpp.

◆ LOGIT_SET_TIME_OFFSET

#define LOGIT_SET_TIME_OFFSET ( logger_index,
offset_ms )
Value:
void set_timestamp_offset(int logger_index, int64_t offset_ms)
Sets timestamp offset for a specific logger.
Definition Logger.hpp:89

Sets timestamp offset for a specific logger.

Parameters
logger_indexIndex of logger.
offset_msOffset in milliseconds.

Definition at line 940 of file LogMacros.hpp.

◆ LOGIT_SHUTDOWN

#define LOGIT_SHUTDOWN ( )
Value:
void shutdown()
Shuts down logger system.
Definition Logger.hpp:238

Macro for shutting down logger system.

Definition at line 966 of file LogMacros.hpp.

◆ LOGIT_STREAM

#define LOGIT_STREAM ( level)
Value:
A stream-based logger that collects log messages using the << operator.
Definition LogStream.hpp:19
std::string make_relative(const std::string &file_path, const std::string &base_path)
Computes the relative path from base_path to file_path.

Begin a log stream for the specified log level.

Definition at line 33 of file LogMacros.hpp.

◆ LOGIT_STREAM_DEBUG

#define LOGIT_STREAM_DEBUG ( )
Value:
#define LOGIT_STREAM(level)
Begin a log stream for the specified log level.
Definition LogMacros.hpp:33

Definition at line 41 of file LogMacros.hpp.

◆ LOGIT_STREAM_DEBUG_TO

#define LOGIT_STREAM_DEBUG_TO ( index)
Value:
#define LOGIT_STREAM_WITH_INDEX(level, index)
Begin a log stream for the specified log level, targeting a specific logger.
Definition LogMacros.hpp:37

Definition at line 48 of file LogMacros.hpp.

◆ LOGIT_STREAM_ERROR

#define LOGIT_STREAM_ERROR ( )
Value:

Definition at line 44 of file LogMacros.hpp.

◆ LOGIT_STREAM_ERROR_TO

#define LOGIT_STREAM_ERROR_TO ( index)
Value:

Definition at line 51 of file LogMacros.hpp.

◆ LOGIT_STREAM_FATAL

#define LOGIT_STREAM_FATAL ( )
Value:

Definition at line 45 of file LogMacros.hpp.

◆ LOGIT_STREAM_FATAL_TO

#define LOGIT_STREAM_FATAL_TO ( index)
Value:

Definition at line 52 of file LogMacros.hpp.

◆ LOGIT_STREAM_INFO

#define LOGIT_STREAM_INFO ( )
Value:

Definition at line 42 of file LogMacros.hpp.

◆ LOGIT_STREAM_INFO_TO

#define LOGIT_STREAM_INFO_TO ( index)
Value:

Definition at line 49 of file LogMacros.hpp.

◆ LOGIT_STREAM_TRACE

#define LOGIT_STREAM_TRACE ( )
Value:

Definition at line 40 of file LogMacros.hpp.

◆ LOGIT_STREAM_TRACE_TO

#define LOGIT_STREAM_TRACE_TO ( index)
Value:

Definition at line 47 of file LogMacros.hpp.

◆ LOGIT_STREAM_WARN

#define LOGIT_STREAM_WARN ( )
Value:

Definition at line 43 of file LogMacros.hpp.

◆ LOGIT_STREAM_WARN_TO

#define LOGIT_STREAM_WARN_TO ( index)
Value:

Definition at line 50 of file LogMacros.hpp.

◆ LOGIT_STREAM_WITH_INDEX

#define LOGIT_STREAM_WITH_INDEX ( level,
index )
Value:

Begin a log stream for the specified log level, targeting a specific logger.

Definition at line 37 of file LogMacros.hpp.

◆ LOGIT_TRACE

#define LOGIT_TRACE ( ...)
Value:

Definition at line 150 of file LogMacros.hpp.

◆ LOGIT_TRACE0

#define LOGIT_TRACE0 ( )

◆ LOGIT_TRACE0_IF

#define LOGIT_TRACE0_IF ( condition)
Value:

Definition at line 278 of file LogMacros.hpp.

◆ LOGIT_TRACE0_TO

#define LOGIT_TRACE0_TO ( index)

◆ LOGIT_TRACE_IF

#define LOGIT_TRACE_IF ( condition,
... )
Value:
if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_TRACE, {}, #__VA_ARGS__, __VA_ARGS__)

Definition at line 277 of file LogMacros.hpp.

◆ LOGIT_TRACE_TO

#define LOGIT_TRACE_TO ( index,
... )
Value:

Definition at line 160 of file LogMacros.hpp.

◆ LOGIT_WAIT

#define LOGIT_WAIT ( )
Value:
void wait()
Waits for all asynchronous loggers to finish processing.
Definition Logger.hpp:228

Macro for waiting for all asynchronous loggers to finish processing.

Definition at line 963 of file LogMacros.hpp.

◆ LOGIT_WARN

#define LOGIT_WARN ( ...)
Value:
LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_WARN, {}, #__VA_ARGS__, __VA_ARGS__)

Definition at line 210 of file LogMacros.hpp.

◆ LOGIT_WARN0

#define LOGIT_WARN0 ( )

◆ LOGIT_WARN0_IF

#define LOGIT_WARN0_IF ( condition)
Value:

Definition at line 308 of file LogMacros.hpp.

◆ LOGIT_WARN0_TO

#define LOGIT_WARN0_TO ( index)

◆ LOGIT_WARN_IF

#define LOGIT_WARN_IF ( condition,
... )
Value:
if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_WARN, {}, #__VA_ARGS__, __VA_ARGS__)

Definition at line 307 of file LogMacros.hpp.

◆ LOGIT_WARN_TO

#define LOGIT_WARN_TO ( index,
... )
Value:
LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, {}, #__VA_ARGS__, __VA_ARGS__)

Definition at line 220 of file LogMacros.hpp.