15 #ifndef A_UTIL_UTIL_LOG_HEADER_INCLUDED
16 #define A_UTIL_UTIL_LOG_HEADER_INCLUDED
100 #define LOG_ADD_ENTRY(__level, ...) \
101 a_util::logging::addEntry(__level, \
102 a_util::strings::format(__VA_ARGS__), \
103 __FILE__ "(" A_UTIL_TO_STRING(__LINE__) ")")
111 #define LOG_DUMP(...) LOG_ADD_ENTRY(a_util::logging::Dump, __VA_ARGS__)
113 #define LOG_DUMP(...)
117 #define LOG_INFO(...) LOG_ADD_ENTRY(a_util::logging::Info, __VA_ARGS__)
123 #define LOG_WARNING(...) LOG_ADD_ENTRY(a_util::logging::Warning, __VA_ARGS__)
129 #define LOG_ERROR(...) LOG_ADD_ENTRY(a_util::logging::Error, __VA_ARGS__)
General function template: encapsulates a function or a method with a single parameter.
Common include for delegate functionality.
std::int64_t timestamp_t
Type of a timestamp value. If not otherwise stated, always in microseconds.
experimental::UnaryDelegate< void, const LogEntry & > Logger
Logger interface definition.
void addEntry(const LogEntry &entry)
Adds a new log entry to the current logger.
std::string defaultFormat(const LogEntry &entry)
Get the default string representation of a log entry.
Logger getLogger()
Get the currently used logger.
void setLogger(Logger log)
Sets the currently used logger.
LogLevel
Usable log levels for LogEntry::log_level.
@ Dump
Log errors, warnings, info and debug messages.
@ Info
Log errors, warnings and info messages.
@ Warning
Log errors and warnings.
void defaultLogger(const LogEntry &entry)
Default logging method, that writes log messages to stdout.
const std::string empty_string
Contains the empty string.
Serves as the root component, with common functionality documented in core functionality.
Public API for string modification and inspection functions.
std::string source
the origin of the entry
std::string message
the message text
std::uint8_t log_level
the log level, see LogLevel.
timestamp_t time_stamp
time stamp of the log message.
Definition of preprocessor macro A_UTIL_TO_STRING.
Public types and functions defining a_util core functionality.