OFFIS DCMTK
Version 3.6.0
|
simple wrapper around the "low-level" Logger object to make it easier to switch to a different system More...
Public Types | |
enum | LogLevel { TRACE_LOG_LEVEL = log4cplus::TRACE_LOG_LEVEL, DEBUG_LOG_LEVEL = log4cplus::DEBUG_LOG_LEVEL, INFO_LOG_LEVEL = log4cplus::INFO_LOG_LEVEL, WARN_LOG_LEVEL = log4cplus::WARN_LOG_LEVEL, ERROR_LOG_LEVEL = log4cplus::ERROR_LOG_LEVEL, FATAL_LOG_LEVEL = log4cplus::FATAL_LOG_LEVEL } |
these are the log levels that you can feed to isEnabledFor() More... | |
Public Member Functions | |
OFLogger (const log4cplus::Logger &base) | |
copy constructor | |
bool | isEnabledFor (log4cplus::LogLevel ll) const |
check if the given log level was activated. | |
void | forcedLog (log4cplus::LogLevel ll, const log4cplus::tstring &message, const char *file=NULL, int line=-1, const char *function=NULL) const |
this function is only used internally by OFLOG_FATAL and friends | |
LogLevel | getChainedLogLevel () const |
Get the logger's log level. | |
Additional Inherited Members | |
![]() | |
void | assertion (bool assertionVal, const log4cplus::tstring &msg) const |
If assertionVal parameter is false , then logs msg with FATAL_LOG_LEVEL log level. | |
void | closeNestedAppenders () const |
Close all attached appenders implementing the AppenderAttachable interface. | |
bool | isEnabledFor (LogLevel ll) const |
Check whether this logger is enabled for a given LogLevel passed as parameter. | |
void | log (LogLevel ll, const log4cplus::tstring &message, const char *file=NULL, int line=-1, const char *function=NULL) const |
This generic form is intended to be used by wrappers. | |
void | forcedLog (LogLevel ll, const log4cplus::tstring &message, const char *file=NULL, int line=-1, const char *function=NULL) const |
This method creates a new logging event and logs the event without further checks. | |
void | callAppenders (const spi::InternalLoggingEvent &event) const |
Call the appenders in the hierrachy starting at this . | |
LogLevel | getChainedLogLevel () const |
Starting from this logger, search the logger hierarchy for a "set" LogLevel and return it. | |
LogLevel | getLogLevel () const |
Returns the assigned LogLevel, if any, for this Logger. | |
void | setLogLevel (LogLevel ll) |
Set the LogLevel of this Logger. | |
Hierarchy & | getHierarchy () const |
Return the the Hierarchy where this Logger instance is attached. | |
log4cplus::tstring | getName () const |
Return the logger name. | |
bool | getAdditivity () const |
Get the additivity flag for this Logger instance. | |
void | setAdditivity (bool additive) |
Set the additivity flag for this Logger instance. | |
virtual void | addAppender (SharedAppenderPtr newAppender) |
virtual SharedAppenderPtrList | getAllAppenders () |
virtual SharedAppenderPtr | getAppender (const log4cplus::tstring &name) |
virtual void | removeAllAppenders () |
virtual void | removeAppender (SharedAppenderPtr appender) |
virtual void | removeAppender (const log4cplus::tstring &name) |
Logger (const Logger &rhs) | |
Logger & | operator= (const Logger &rhs) |
void | swap (Logger &) |
Logger | getParent () const |
Used to retrieve the parent of this Logger in the Logger tree. | |
![]() | |
static bool | exists (const log4cplus::tstring &name) |
Returns true if the named logger exists (in the default hierarchy). | |
static LoggerList | getCurrentLoggers () |
static Hierarchy & | getDefaultHierarchy () |
Return the default Hierarchy instance. | |
static Logger | getInstance (const log4cplus::tstring &name) |
Retrieve a logger with name name . | |
static Logger | getInstance (const log4cplus::tstring &name, spi::LoggerFactory &factory) |
Like getInstance() except that the type of logger instantiated depends on the type returned by the spi::LoggerFactory#makeNewLoggerInstance method of the factory parameter. | |
static Logger | getRoot () |
Return the root of the default logger hierrachy. | |
static void | shutdown () |
Calling this method will safely close and remove all appenders in all the loggers including root contained in the default hierachy. | |
simple wrapper around the "low-level" Logger object to make it easier to switch to a different system
enum OFLogger::LogLevel |
these are the log levels that you can feed to isEnabledFor()
OFLogger::OFLogger | ( | const log4cplus::Logger & | base | ) |
copy constructor
base | object to be copied |
|
inline |
Get the logger's log level.
One of the checks that isEnabledFor() does looks like this: if (getChainedLogLevel() < level) return false;
|
inline |
check if the given log level was activated.
This can be used to check if a given log level is activated before spending cpu time on generating a log message. The OFLOG_* macros use this automatically, so you should never do something like: if (myLogger.isEnabledFor(INFO_LOG_LEVEL)) OFLOG_INFO("Doing it like this is pointless);
ll | the log level to check for |