Controls the logging facility. More...
#include <ndn-cxx/util/logging.hpp>
Static Public Member Functions | |
static void | flush () |
Flush log backend. More... | |
static std::set< std::string > | getLoggerNames () |
Get list of all registered logger names. 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 |
Flush log backend.
This ensures all log messages are written to the destination stream.
Definition at line 204 of file logging.hpp.
|
inlinestatic |
Get list of all registered logger names.
Definition at line 180 of file logging.hpp.
|
inlinestatic |
Set log destination.
os | a stream for log output |
The initial destination is std::clog
.
Definition at line 198 of file logging.hpp.
|
static |
Set log destination.
os | a stream for log output; caller must ensure it remains valid until setDestination() is invoked again or program exits |
This is equivalent to setDestination(shared_ptr<std::ostream>(&os, nullDeleter))
.
Definition at line 203 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 that prefix, or "*" for all modules |
level | minimum severity level |
Log messages are output only if their severity is greater than the current minimum severity level. The initial severity level is LogLevel::NONE
, which enables FATAL messages only.
Definition at line 186 of file logging.hpp.
|
inlinestatic |
Set severity levels with a config string.
config | colon-separated key=value pairs |
std::invalid_argument | config string is malformed |
is equivalent to:
Definition at line 192 of file logging.hpp.