Kea
1.9.9-git
|
Logger Manager Implementation. More...
#include <logger_manager_impl.h>
Public Member Functions | |
LoggerManagerImpl () | |
Constructor. More... | |
void | processEnd () |
End Processing. More... | |
void | processInit () |
Initialize Processing. More... | |
Static Public Member Functions | |
static void | init (isc::log::Severity severity=isc::log::INFO, int dbglevel=0, bool buffer=false) |
Implementation-specific initialization. More... | |
static void | processSpecification (const LoggerSpecification &spec) |
Process Specification. More... | |
static void | reset (isc::log::Severity severity=isc::log::INFO, int dbglevel=0) |
Reset logging. More... | |
Logger Manager Implementation.
This is the implementation of the logger manager for the log4cplus underlying logger.
As noted in logger_manager.h, the logger manager class exists to set up the logging given a set of specifications. This class handles the processing of those specifications.
Note: the logging has been implemented using a "pimpl" idiom to conceal the underlying implementation (log4cplus) from the Kea interface. This requires that there be an implementation class, even though in this case, all the implementation class methods can be declared static.
Definition at line 42 of file logger_manager_impl.h.
|
inline |
Constructor.
Definition at line 46 of file logger_manager_impl.h.
|
static |
Implementation-specific initialization.
Sets the basic configuration for logging (the root logger has INFO and more severe messages routed to stdout). Unless this function (or process() with a valid specification for all loggers that will log messages) is called before a message is logged, log4cplus will output a message to stderr noting that logging has not been initialized.
It is assumed here that the name of the Kea root logger can be obtained from the global function getRootLoggerName().
severity | Severity to be associated with this logger |
dbglevel | Debug level associated with the root logger |
buffer | If true, all log messages will be buffered until one of the process() methods is called. If false, initial logging shall go to the default output (i.e. stdout) |
Definition at line 186 of file logger_manager_impl.cc.
void isc::log::LoggerManagerImpl::processEnd | ( | ) |
End Processing.
Terminates the processing of the logging specifications.
Definition at line 56 of file logger_manager_impl.cc.
void isc::log::LoggerManagerImpl::processInit | ( | ) |
Initialize Processing.
This resets the hierarchy of loggers back to their defaults. This means that all non-root loggers (if they exist) are set to NOT_SET, and the root logger reset to logging informational messages.
Definition at line 47 of file logger_manager_impl.cc.
|
static |
Process Specification.
Processes the specification for a single logger.
spec | Logging specification for this logger |
Definition at line 63 of file logger_manager_impl.cc.
References isc::log::LoggerSpecification::begin(), isc::log::LoggerSpecification::end(), isc::log::expandLoggerName(), isc::log::LoggerSpecification::getAdditive(), isc::log::LoggerSpecification::getDbglevel(), isc::log::LoggerSpecification::getName(), isc::log::LoggerSpecification::getSeverity(), isc_throw, isc::asiodns::logger, and isc::log::LoggerSpecification::optionCount().
|
static |
Reset logging.
Resets to default configuration (root logger logging to the console with INFO severity).
severity | Severity to be associated with this logger |
dbglevel | Debug level associated with the root logger |
Definition at line 206 of file logger_manager_impl.cc.