ADTF  3.18.2
workspace/conan/dev_essential/1.3.3/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/a_util/logging/log.h File Reference

Public API for Logger type, functions and macros. More...

Go to the source code of this file.

Classes

struct  LogEntry
 A log entry. More...
 

Namespaces

 a_util
 Serves as the root component, with common functionality documented in core functionality.
 
 a_util::logging
 Serves as component for basic logging functionality.
 

Macros

#define LOG_ADD_ENTRY(__level, ...)
 Add a log entry to the current logger, including current filename and line number. More...
 
#define LOG_DUMP(...)
 Log a message with LogLevel Dump (only in Debug mode)
 
#define LOG_INFO(...)   LOG_ADD_ENTRY(a_util::logging::Info, __VA_ARGS__)
 Log a message with LogLevel Info.
 
#define LOG_WARNING(...)   LOG_ADD_ENTRY(a_util::logging::Warning, __VA_ARGS__)
 Log a message with LogLevel Warning.
 
#define LOG_ERROR(...)   LOG_ADD_ENTRY(a_util::logging::Error, __VA_ARGS__)
 Log a message with LogLevel Error.
 

Typedefs

typedef experimental::UnaryDelegate< void, const LogEntry & > Logger
 Logger interface definition.
 

Enumerations

enum  LogLevel {
  None = 0 , Error = 10 , Warning = 20 , Info = 30 ,
  Dump = 40 , Debug = Dump , All = 0xFF
}
 Usable log levels for LogEntry::log_level. More...
 

Functions

void addEntry (const LogEntry &entry)
 Adds a new log entry to the current logger. More...
 
void addEntry (std::uint8_t log_level, const std::string &message=a_util::strings::empty_string, const std::string &source=a_util::strings::empty_string)
 Adds a new log entry to the current logger. More...
 
void setLogger (Logger log)
 Sets the currently used logger. More...
 
Logger getLogger ()
 Get the currently used logger. More...
 
std::string defaultFormat (const LogEntry &entry)
 Get the default string representation of a log entry. More...
 
void defaultLogger (const LogEntry &entry)
 Default logging method, that writes log messages to stdout. More...
 

Detailed Description

Public API for Logger type, functions and macros.

Definition in file workspace/conan/dev_essential/1.3.3/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/a_util/logging/log.h.

Macro Definition Documentation

◆ LOG_ADD_ENTRY

#define LOG_ADD_ENTRY (   __level,
  ... 
)
Value:
a_util::strings::format(__VA_ARGS__), \
__FILE__ "(" A_UTIL_TO_STRING(__LINE__) ")")
#define A_UTIL_TO_STRING(expression)
Converts an expression to its string representation during preprocessing.
Definition: to_string.h:31
void addEntry(const LogEntry &entry)
Adds a new log entry to the current logger.
std::string format(const char *str_format,...)
printf()-like formatting of an input string.

Add a log entry to the current logger, including current filename and line number.

Parameters
[in]__levelThe log level
[in]...Arguments forwarded to printf()-like formatting

Definition at line 100 of file workspace/conan/dev_essential/1.3.3/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/a_util/logging/log.h.