![]() |
Kea 2.5.5
|
#include <logger.h>
Public Types | |
typedef isc::log::Formatter< Logger > | Formatter |
The formatter used to replace placeholders. More... | |
Public Member Functions | |
Logger (const char *name) | |
Constructor. More... | |
virtual | ~Logger () |
Destructor. More... | |
Formatter | debug (int dbglevel, const MessageID &ident) |
Output Debug Message. More... | |
Formatter | error (const MessageID &ident) |
Output Error Message. More... | |
Formatter | fatal (const MessageID &ident) |
Output Fatal Message. More... | |
virtual int | getDebugLevel () |
Return DEBUG Level. More... | |
virtual int | getEffectiveDebugLevel () |
Get Effective Debug Level for Logger. More... | |
virtual isc::log::Severity | getEffectiveSeverity () |
Get Effective Severity Level for Logger. More... | |
virtual std::string | getName () |
Get Name of Logger. More... | |
virtual isc::log::Severity | getSeverity () |
Get Severity Level for Logger. More... | |
bool | hasAppender (OutputOption::Destination const destination) |
Check if this logger has an appender of the given type. More... | |
Formatter | info (const MessageID &ident) |
Output Informational Message. More... | |
virtual bool | isDebugEnabled (int dbglevel=MIN_DEBUG_LEVEL) |
Returns if Debug Message Should Be Output. More... | |
virtual bool | isErrorEnabled () |
Is ERROR Enabled? More... | |
virtual bool | isFatalEnabled () |
Is FATAL Enabled? More... | |
virtual bool | isInfoEnabled () |
Is INFO Enabled? More... | |
virtual bool | isWarnEnabled () |
Is WARNING Enabled? More... | |
bool | operator== (Logger &other) |
Equality. More... | |
void | setInterprocessSync (isc::log::interprocess::InterprocessSync *sync) |
Replace the interprocess synchronization object. More... | |
virtual void | setSeverity (isc::log::Severity severity, int dbglevel=1) |
Set Severity Level for Logger. More... | |
Formatter | warn (const MessageID &ident) |
Output Warning Message. More... | |
Static Public Member Functions | |
static std::string | getVersion () |
Version. More... | |
Static Public Attributes | |
static const size_t | MAX_LOGGER_NAME_SIZE = 31 |
Maximum size of a logger name. More... | |
Friends | |
class | isc::log::Formatter< Logger > |
Logger Class.
This class is the main class used for logging. Use comprises:
Definition at line 142 of file log/logger.h.
The formatter used to replace placeholders.
Definition at line 192 of file log/logger.h.
|
inline |
Constructor.
Creates/attaches to a logger of a specific name.
name | Name of the logger. If the name is that of the root name, this creates an instance of the root logger; otherwise it creates a child of the root logger. |
Definition at line 164 of file log/logger.h.
References isc_throw, and MAX_LOGGER_NAME_SIZE.
|
virtual |
Destructor.
Definition at line 51 of file log/logger.cc.
Logger::Formatter isc::log::Logger::debug | ( | int | dbglevel, |
const MessageID & | ident | ||
) |
Output Debug Message.
dbglevel | Debug level, ranging between 0 and 99. Higher numbers are used for more verbose output. |
ident | Message identification. |
Definition at line 151 of file log/logger.cc.
References isc::log::DEBUG, and isDebugEnabled().
Logger::Formatter isc::log::Logger::error | ( | const MessageID & | ident | ) |
Output Error Message.
ident | Message identification. |
Definition at line 181 of file log/logger.cc.
References isc::log::ERROR, and isErrorEnabled().
Referenced by isc::log::LoggerManager::readLocalMessageFile().
Logger::Formatter isc::log::Logger::fatal | ( | const MessageID & | ident | ) |
Output Fatal Message.
ident | Message identification. |
Definition at line 191 of file log/logger.cc.
References isc::log::FATAL, and isFatalEnabled().
|
virtual |
Return DEBUG Level.
Definition at line 97 of file log/logger.cc.
References getDebugLevel().
Referenced by getDebugLevel().
|
virtual |
Get Effective Debug Level for Logger.
Definition at line 105 of file log/logger.cc.
References getEffectiveDebugLevel().
Referenced by getEffectiveDebugLevel().
|
virtual |
Get Effective Severity Level for Logger.
Definition at line 90 of file log/logger.cc.
References getEffectiveSeverity().
Referenced by getEffectiveSeverity().
|
virtual |
Get Name of Logger.
Definition at line 69 of file log/logger.cc.
References getName().
Referenced by getName().
|
virtual |
Get Severity Level for Logger.
Definition at line 83 of file log/logger.cc.
References getSeverity().
Referenced by getSeverity().
|
static |
Version.
Definition at line 62 of file log/logger.cc.
References isc::log::LoggerImpl::getVersion().
Referenced by isc::process::DControllerBase::getVersion().
bool isc::log::Logger::hasAppender | ( | OutputOption::Destination const | destination | ) |
Check if this logger has an appender of the given type.
destination | the appender type to be checked: console, file or syslog |
Definition at line 208 of file log/logger.cc.
References isc::log::LoggerImpl::hasAppender().
Logger::Formatter isc::log::Logger::info | ( | const MessageID & | ident | ) |
Output Informational Message.
ident | Message identification. |
Definition at line 161 of file log/logger.cc.
References isc::log::INFO, and isInfoEnabled().
Referenced by isc::log::LoggerManager::readLocalMessageFile().
|
virtual |
Returns if Debug Message Should Be Output.
dbglevel | Level for which debugging is checked. Debugging is enabled only if the logger has DEBUG enabled and if the dbglevel checked is less than or equal to the debug level set for the logger. |
Definition at line 112 of file log/logger.cc.
References isDebugEnabled().
Referenced by debug(), and isDebugEnabled().
|
virtual |
Is ERROR Enabled?
Definition at line 127 of file log/logger.cc.
References isErrorEnabled().
Referenced by error(), and isErrorEnabled().
|
virtual |
Is FATAL Enabled?
Definition at line 132 of file log/logger.cc.
References isFatalEnabled().
Referenced by fatal(), and isFatalEnabled().
|
virtual |
Is INFO Enabled?
Definition at line 117 of file log/logger.cc.
References isInfoEnabled().
Referenced by info(), and isInfoEnabled().
|
virtual |
Is WARNING Enabled?
Definition at line 122 of file log/logger.cc.
References isWarnEnabled().
Referenced by isWarnEnabled(), and warn().
bool isc::log::Logger::operator== | ( | Logger & | other | ) |
Equality.
Check if two instances of this logger refer to the same stream.
Definition at line 215 of file log/logger.cc.
void isc::log::Logger::setInterprocessSync | ( | isc::log::interprocess::InterprocessSync * | sync | ) |
Replace the interprocess synchronization object.
If this method is called with null as the argument, it throws a BadInterprocessSync exception.
sync | The logger uses this synchronization object for synchronizing output of log messages. It should be deletable and the ownership is transferred to the logger. If null is passed, a BadInterprocessSync exception is thrown. |
Definition at line 203 of file log/logger.cc.
References isc::log::LoggerImpl::setInterprocessSync().
Referenced by isc::log::LoggerManager::readLocalMessageFile().
|
virtual |
Set Severity Level for Logger.
Sets the level at which this logger will log messages. If none is set, the level is inherited from the parent.
severity | Severity level to log |
dbglevel | If the severity is DEBUG, this is the debug level. This can be in the range 1 to 100 and controls the verbosity. A value outside these limits is silently coerced to the nearest boundary. |
Definition at line 76 of file log/logger.cc.
References isc::log::LoggerImpl::setSeverity().
Logger::Formatter isc::log::Logger::warn | ( | const MessageID & | ident | ) |
Output Warning Message.
ident | Message identification. |
Definition at line 171 of file log/logger.cc.
References isWarnEnabled(), and isc::log::WARN.
Referenced by isc::log::LoggerManager::readLocalMessageFile().
|
friend |
Definition at line 310 of file log/logger.h.
|
static |