OFLogger Class Reference

simple wrapper around the "low-level" Logger object to make it easier to switch to a different system More...

Inheritance diagram for OFLogger:

log4cplus::Logger List of all members.

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.

Detailed Description

simple wrapper around the "low-level" Logger object to make it easier to switch to a different system

Definition at line 49 of file oflog.h.


Member Enumeration Documentation

enum OFLogger::LogLevel

these are the log levels that you can feed to isEnabledFor()

Enumerator:
TRACE_LOG_LEVEL  trace: output more details on the internal application state, a kind of "verbose debug"
DEBUG_LOG_LEVEL  debug: fine-grained informational events that are most useful to debug an application
INFO_LOG_LEVEL  info: informational messages that highlight the progress of the application at coarse-grained level
WARN_LOG_LEVEL  warn: potentially harmful situations
ERROR_LOG_LEVEL  error: events that might still allow the application to continue running
FATAL_LOG_LEVEL  fatal: very severe error events that will presumably lead the application to abort

Definition at line 58 of file oflog.h.


Constructor & Destructor Documentation

OFLogger::OFLogger ( const log4cplus::Logger base  ) 

copy constructor

Parameters:
base object to be copied


Member Function Documentation

bool OFLogger::isEnabledFor ( log4cplus::LogLevel  ll  )  const [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);

Parameters:
ll the log level to check for
Returns:
true if messages on this level won't be discarded

Definition at line 82 of file oflog.h.

LogLevel OFLogger::getChainedLogLevel (  )  const [inline]

Get the logger's log level.

One of the checks that isEnabledFor() does looks like this: if (getChainedLogLevel() < level) return false;

Returns:
the log level to which this logger is set.

Reimplemented from log4cplus::Logger.

Definition at line 98 of file oflog.h.


The documentation for this class was generated from the following file:


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1