Main Page Namespace List Class Hierarchy Compound List File List Compound Members File Members Related Pages
Quick User Guide
1. The 5 basic macros
In a single threaded application, you will probably want to use the 5 basic macros.
call this macro only once : first line in main() LOB_TRACE_INIT("lobtracestream.ini", "myapp_");
LOB_TRACE_ENTRY(UTILS, "MyClass::getValue(int i)");
LOB_TRACE_RETURN(UTILS, "MyClass::getValue(int)", retCode);
LOB_TRACE(UTILS, DEBUG) << "Hello world, i = " << i << lt_endl;
use this instead of 'throw'
In a multi-threaded application, you will need to use 5 other macros.
Version 1.1.x has no mutual exclusion mechanism allowing to log all thread traces in a single file (this because I don't know yet what mutex works on both Unix & M$ Windows).
Therefore, you will have to instanciate one LobTraceProvider and one LobTraceStream per thread.
The following macros are very similar to the basic macros: They have just one more parameter to specify which provider/stream is meant.
Call this macro only once, but for each LobTraceProvider LOB_TRACE_INIT_MT(g_LTProvider2, "lobtracestream.ini", "myapp_");
LOB_TRACE_ENTRY_MT(g_LTStream2, UTILS, "MyClass::getValue(int i)");
LOB_TRACE_RETURN_MT(g_LTStream2, UTILS, "MyClass::getValue(int)", retCode);
LOB_TRACE_MT(g_LTStream2, UTILS, DEBUG) << "Hello world, i = " << i << lt_endl;
use this instead of 'throw' LOB_EXCEPTION_MT(g_LTStream2, bad_value, "negative counter exception");
The LobTrace configuration file is read at trace initialization (commonly: at the application startup).
It contains (optional) trace configuration variables and the TraceLevels for each of your modules.
LogDirectory Path to where the log files will be stored.
LogFileMaxLines logFile size limit, a new file is created when reached.
LogFilePrefix Filename prefix for logFiles
LogFileExt Filename extension for logFiles
TraceInXML logFile content is in XML
LogDirectory = "./Log"
LogFileMaxLines = "1000"
LogFilePrefix = "myApp_"
LogFileExt = ".xml"
TraceInXML = "yes"
Trace Levels are: INOUT, TRACE, DEBUG, WARNING, ERROR, CRITICAL and EXCEPTION
If tracelevel is set to WARNING,
then all traces arriving with level WARNING, ERROR, CRITICAL and EXCEPTION are logged.
INOUT, TRACE and DEBUG are rejected.
GENERAL = "WARNING"
UTILS = "DEBUG"
DEMOMODULE = "TRACE"
...
Generated on Sun Dec 15 23:17:22 2002 for LobTraceStream by
1.2.12 written by Dimitri van Heesch,
© 1997-2001