33 #include "dcmtk/config/osconfig.h"
36 #include "dcmtk/ofstd/oftypes.h"
37 #include "dcmtk/ofstd/ofconapp.h"
39 #define OFLOG_TRACE(logger, msg) LOG4CPLUS_TRACE(logger, msg)
40 #define OFLOG_DEBUG(logger, msg) LOG4CPLUS_DEBUG(logger, msg)
41 #define OFLOG_INFO(logger, msg) LOG4CPLUS_INFO(logger, msg)
42 #define OFLOG_WARN(logger, msg) LOG4CPLUS_WARN(logger, msg)
43 #define OFLOG_ERROR(logger, msg) LOG4CPLUS_ERROR(logger, msg)
44 #define OFLOG_FATAL(logger, msg) LOG4CPLUS_FATAL(logger, msg)
83 return Logger::isEnabledFor(ll);
88 const char* file=NULL,
int line=-1,
const char*
function=NULL)
const {
89 Logger::forcedLog(ll, message, file, line,
function);
99 return OFstatic_cast(
LogLevel, Logger::getChainedLogLevel());
static void configureFromCommandLine(OFCommandLine &cmd, OFConsoleApplication &app)
handle the command line options used for logging
bool isEnabledFor(log4cplus::LogLevel ll) const
check if the given log level was activated.
warn: potentially harmful situations
static OFLogger getLogger(const char *name)
create a new Logger object
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
functions for initializing the logging system
support class for console applications.
LogLevel
these are the log levels that you can feed to isEnabledFor()
This is the central class in the log4cplus package.
info: informational messages that highlight the progress of the application at coarse-grained level ...
static OFauto_ptr< log4cplus::helpers::Properties > configProperties_
If we loaded a config file in configureFromCommandLine(), this is it.
fatal: very severe error events that will presumably lead the application to abort ...
OFLog()
private constructor, don't create instances of this class
debug: fine-grained informational events that are most useful to debug an application ...
error: events that might still allow the application to continue running
LogLevel getChainedLogLevel() const
Get the logger's log level.
static void configure(OFLogger::LogLevel level=OFLogger::WARN_LOG_LEVEL)
set up the logging and enable it
This header defines the Logger class and the logging macros.
OFLogger(const log4cplus::Logger &base)
copy constructor
static void configureLogger(log4cplus::LogLevel level)
set up the logging and enable it
simple wrapper around the "low-level" Logger object to make it easier to switch to a different system...
trace: output more details on the internal application state, a kind of "verbose debug" ...
a simple string class that implements a subset of std::string.
static void reconfigure(OFCommandLine *cmd=NULL)
if there was a config file loaded in configureFromCommandLine(), the in-memory copy will be parsed ag...
handles command line arguments.
static void addOptions(OFCommandLine &cmd)
add the command line options which configureFromCommandLine() checks for