AnCH logging library namespace. More...
Namespaces | |
| namespace | fmt |
| Logger message formatters. | |
| namespace | lvl |
| Logging levels as types for the stream API. | |
Classes | |
| class | ConsoleWriter |
| Log file writer. More... | |
| class | FileWriter |
| Log file writer. More... | |
| struct | LevelTag |
| class | Logger |
| class | LoggerConfiguration |
| class | LoggerFactory |
| Logger factory. More... | |
| class | LogLine |
| class | LowPriorityWriter |
| class | MapDiagnosticContext |
| Map Diagnostic Context. More... | |
| class | NoopStream |
| class | ThreadSafeWriter |
| class | Writer |
| Logger writter definition. More... | |
| class | WriterRegistry |
| Logger writers' registry. More... | |
Typedefs | |
| using | CreateWriter = std::function<anch::log::Writer*(bool, bool, const anch::conf::Section&)> |
Enumerations | |
| enum class | Level { TRACE = 0 , DEBUG = 10 , INFO = 20 , WARN = 30 , ERROR = 40 , FATAL = 50 } |
Functions | |
| template<anch::log::Level L> | |
| auto | operator<< (const anch::log::Logger &logger, anch::log::LevelTag< L > level) noexcept |
Variables | |
| const std::string | DEFAULT |
| const std::string | MODULE |
| const std::string | THREAD_SAFE |
| const std::string | LOW_PRIORITY |
| const std::string | WRITER |
| const std::string | WRITERS |
| const std::string | LOGGER |
| const std::string | LEVEL |
| const std::string | NS_LOG |
| const std::string | WRITER_FILE |
| const std::string | WRITER_TERM |
| const std::map< const Level, const std::string > | LEVEL_LABEL |
| const std::map< const std::string, const Level > | LABEL_LEVEL |
| constexpr anch::log::Level | MIN_LEVEL = anch::log::Level::ANCH_LOG_MIN_LEVEL |
| const std::string | MDC_THREAD_ID |
| std::map< std::string, std::string > | MDC_CONST |
| MapDiagnosticContext | MDC |
AnCH logging library namespace.
It contains the logging library: LoggerFactory retrieves configured Logger instances, which write messages through writers. Messages can be logged with variadic methods (LOG.info("value=", value) ) or with stream injection (log/stream.hpp ).
| using anch::log::CreateWriter = std::function<anch::log::Writer*(bool, bool, const anch::conf::Section&)> |
Create writer definition
| threadSafe | default thread safe flag |
| lowPriority | default low priority flag |
| section | the writer section |
|
strong |
|
nodiscardnoexcept |
Start a log line.
Return type depends on level: NoopStream when level is lower than MIN_LEVEL , LogLine otherwise.
| logger | The logger |
| level | The level (anch::log::lvl::debug , ...) |
|
extern |
'' constant
|
extern |
Labels->levels for logging definition
|
extern |
'level' constant
|
extern |
Level->labels for logging defintion
|
extern |
'logger' constant
|
extern |
'low-priority' constant
|
externthread_local |
MapDiagnosticContext current thread instance
|
extern |
MDC constant values
|
extern |
Thread ID key in diagnostic context
|
inlineconstexpr |
Compile-time logging threshold (set with ANCH_LOG_MIN_LEVEL ).
Messages in lower levels are removed at compilation.
|
extern |
'module' constant
|
extern |
'anch::log' constant
|
extern |
'thread-safe' constant
|
extern |
'writer' constant
|
extern |
'file' constant
|
extern |
'console' constant
|
extern |
'writers' constant