MI - Fimex
|
#include <fimex/Logger.h>
Public Types | |
enum | LogLevel { OFF = 1000, FATAL = 900, ERROR = 800, WARN = 700, INFO = 600, DEBUG = 500 } |
enum | LogClass { LOG2STDERR = 0, LOG4CPP = 1 } |
Public Member Functions | |
Logger (const std::string &className) | |
~Logger () | |
bool | isEnabledFor (LogLevel level) |
void | reset () |
void | forcedLog (LogLevel level, const std::string &message, const char *filename, unsigned int lineNumber) |
Static Public Member Functions | |
static bool | setClass (LogClass logClass) |
static bool | setClass (LoggerClass *lc) |
Interface and default (dummy) implementation for a logger. Don't use this class directly, but retrieve a pointer to it via the getLogger function and log with the LOG4FIMEX macro.
To switch to another logger-implementation, e.g. log4cpp, use setClass() and eventually implement the Logger-initialization (e.g. for log4cpp via filename)
MetNoFimex::Logger::Logger | ( | const std::string & | className | ) |
MetNoFimex::Logger::~Logger | ( | ) |
void MetNoFimex::Logger::forcedLog | ( | LogLevel | level, |
const std::string & | message, | ||
const char * | filename, | ||
unsigned int | lineNumber | ||
) |
log for this loglevel
level | log-level to log |
message | log-message |
filename | best retrieved with FILE |
lineNumber | best retrieved with LINE |
bool MetNoFimex::Logger::isEnabledFor | ( | LogLevel | level | ) |
check if the loglevel of this logger is active
void MetNoFimex::Logger::reset | ( | ) |
Delete the present logger implementation.
|
static |
choose a loggerclass in fimex (default is STDERR)
logClass |
|
static |
Choose a loggerclass in fimex
Changing LoggerClass after invoking any functions in the library (more precisely, after any creation of LoggerImpl objects), is experimental.
Ownership of lc is transferred. To destroy the LoggerClass, e.g. before exit, it is necessary to call setClass(0).
lc,ownership | is transferred; deletes the present loggerclass instance |