controls the logging facility More...
#include <logging.hpp>
Static Public Member Functions | |
static void | addLogger (Logger &logger) |
register a new logger More... | |
static void | flush () |
flush log backend More... | |
static std::set< std::string > | getLoggerNames () |
get list of names of all registered loggers More... | |
static void | setDestination (shared_ptr< std::ostream > os) |
set log destination More... | |
static void | setDestination (std::ostream &os) |
set log destination More... | |
static void | setLevel (const std::string &prefix, LogLevel level) |
set severity level More... | |
static void | setLevel (const std::string &config) |
set severity levels with a config string More... | |
controls the logging facility
Definition at line 46 of file logging.hpp.
|
inlinestatic |
register a new logger
NDN_LOG_INIT
macro. Definition at line 180 of file logging.hpp.
|
inlinestatic |
flush log backend
This ensures log messages are written to the destination stream.
Definition at line 210 of file logging.hpp.
|
inlinestatic |
get list of names of all registered loggers
Definition at line 186 of file logging.hpp.
|
inlinestatic |
set log destination
os | a stream for log output |
Initial destination is std::clog
.
Definition at line 204 of file logging.hpp.
|
static |
set log destination
os | a stream for log output; caller must ensure this is valid until setDestination is invoked again or program exits |
This is equivalent to setDestination(shared_ptr<std::ostream>(&os, nullDeleter))
Definition at line 200 of file logging.cpp.
|
inlinestatic |
set severity level
prefix | logger prefix; this can be a specific logger name, a general prefix like ndn.a.* to apply a setting for all modules that contain this prefix, or "*" for all modules |
level | minimum severity level |
Log messages are output only if its severity is greater than the set minimum severity level. Initial default severity level is LogLevel::NONE
which enables FATAL only.
Definition at line 192 of file logging.hpp.
|
inlinestatic |
set severity levels with a config string
config | colon-separate key=value pairs |
std::invalid_argument | config string is malformed |
is equivalent to
Definition at line 198 of file logging.hpp.