#include <lobtracestream.h>
Public Types | |
enum | traceLevels { InOut = 0, Debug, Trace, Warning, Error, Critical, Exception } |
traceLevels to be used for eachg trace. More... | |
Public Methods | |
LobTraceProvider () | |
virtual | ~LobTraceProvider () |
void | initialize (const char *confFilename, const char *logFilePrefix) |
Reads LobTrace config file to set module trace-levels. More... | |
virtual void | onTrace (LobTraceStream ¶m) |
formats & writes a trace message to the output Stream. More... | |
void | setModuleTraceLevel (int moduleId, int level) |
Set trace level for the given module. More... | |
bool | isTraced (int module, int level) |
Returns if yes(true) or no, this trace is to be taken in consideration. More... | |
bool | isTraced (int module, traceLevels level) |
Returns if yes(true) or no, this trace is to be taken in consideration. More... | |
const char * | getLogFilename () |
const bool | isXmlTrace () |
virtual void | dump () |
writes a complete XML description of this instance to cout. More... | |
Friends | |
ostream & | operator<< (ostream &os, LobTraceProvider <p) |
Provides a formated description of this LobTraceProvider instance. More... |
A LobTraceProvider instance will write a LobTraceStream to a file (or any other output, like cout).
Before beeing written to a file, the LobTraceStream will be checked, to see if its traceLevel is allowed to be logged (module, traceLevel).
The message will then be formatted (date, time, ...) and written to the output stream.
|
traceLevels to be used for eachg trace.
A traceLevel has to be specified for each trace you add in your code. |
|
|
|
|
|
writes a complete XML description of this instance to cout.
|
|
|
|
Reads LobTrace config file to set module trace-levels.
This method will read the confFilename config file to set the trace level for each module of your application. Trace outputs are written in a file which name begins with logFilePrefix. if NULL, then trace filenames will start with "lobtrace_"
|
|
Returns if yes(true) or no, this trace is to be taken in consideration.
All tracelevels that are >= to the one specified for the given module are traced. the others are not logged.
example: |
|
Returns if yes(true) or no, this trace is to be taken in consideration.
All tracelevels that are >= to the one specified for the given module are traced. the others are not logged.
example:
|
|
|
|
formats & writes a trace message to the output Stream.
A new LobTraceStream needs to be logged, this method formats the message and prints it to the output stream (file/cout)
|
|
Set trace level for the given module.
Trace Levels are: INOUT, TRACE, DEBUG, WARNING, ERROR and CRITICAL
If tracelevel is set to WARNING, |
|
Provides a formated description of this LobTraceProvider instance.
|