Kea 2.7.6
|
Logger Manager Implementation. More...
#include <logger_manager_impl.h>
Public Member Functions | |
LoggerManagerImpl () | |
Constructor. | |
void | processEnd () |
End Processing. | |
void | processInit () |
Initialize Processing. | |
void | processSpecification (const LoggerSpecification &spec) |
Process Specification. | |
Static Public Member Functions | |
static void | init (isc::log::Severity severity=isc::log::INFO, int dbglevel=0, bool buffer=false) |
Implementation-specific initialization. | |
static void | reset (isc::log::Severity severity=isc::log::INFO, int dbglevel=0) |
Reset logging. | |
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 222 of file logger_manager_impl.cc.
References isc::log::LoggerLevelImpl::init().
Referenced by isc::log::LoggerManager::init().
void isc::log::LoggerManagerImpl::processEnd | ( | ) |
End Processing.
Terminates the processing of the logging specifications.
Definition at line 57 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 48 of file logger_manager_impl.cc.
void isc::log::LoggerManagerImpl::processSpecification | ( | const LoggerSpecification & | spec | ) |
Process Specification.
Processes the specification for a single logger.
spec | Logging specification for this logger |
Definition at line 64 of file logger_manager_impl.cc.
References isc::log::LoggerLevelImpl::convertFromBindLevel(), isc::log::expandLoggerName(), isc::log::LoggerSpecification::getAdditive(), isc::log::LoggerSpecification::getDbglevel(), isc::log::LoggerSpecification::getName(), isc::log::getRootLoggerName(), isc::log::LoggerSpecification::getSeverity(), 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 242 of file logger_manager_impl.cc.
Referenced by isc::log::LoggerManager::reset().