|
ADTF
|
Serves as component for basic logging functionality. More...
Classes | |
| struct | LogEntry |
| A log entry. More... | |
Typedefs | |
| typedef experimental::UnaryDelegate< void, const LogEntry & > | Logger |
Enumerations | |
| enum | LogLevel { None = 0 , Error = 10 , Warning = 20 , Info = 30 , Dump = 40 , Debug = Dump , All = 0xFF } |
Functions | |
| void | addEntry (const LogEntry &entry) |
| 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) |
| void | setLogger (Logger log) |
| Logger | getLogger () |
| std::string | defaultFormat (const LogEntry &entry) |
| void | defaultLogger (const LogEntry &entry) |
Serves as component for basic logging functionality.
| typedef experimental::UnaryDelegate<void, const LogEntry&> a_util::logging::Logger |
Logger interface definition
Usable log levels for LogEntry::log_level
Severity ordered from high to low.
| void a_util::logging::addEntry | ( | const LogEntry & | entry | ) |
Adds a new log entry to the current logger.
| [in] | entry | The new log entry. |
| void a_util::logging::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. Automatically timestamps the entry.
| [in] | log_level | The severity, LogLevel. |
| [in] | message | The message text (optional) |
| [in] | source | A string describing the source location (optional). |
| std::string a_util::logging::defaultFormat | ( | const LogEntry & | entry | ) |
Get the default string representation of a log entry.
| [in] | entry | The log entry. |
| void a_util::logging::defaultLogger | ( | const LogEntry & | entry | ) |
Default logging method, that writes log messages to stdout.
| [in] | entry | The log entry. |
| Logger a_util::logging::getLogger | ( | ) |
Get the currently used logger.
| void a_util::logging::setLogger | ( | Logger | log | ) |
Sets the currently used logger.
| [in] | log | The new logger method. |