Class to encapsulate tracing functions.
![]() | Options Options for trace output. |
![]() | Block Class to trace Execution blocks. |
Class to encapsulate tracing functions. This class does not require any instances and is only being used as a method of grouping functions together in a name space.
DateAndTime
Timestamp
Thread
TraceLevel
FileAndLine
ThreadAddress
SystemLogStream
A trace output of the program name version and OS is written as well.
Note this function OR's the bits included in the options parameter.
Note this function AND's the complement of the bits included in the options
parameter.
So a typical usage would be:
So a typical usage would be:
static void SetOptions(unsigned options )
static void ClearOptions(unsigned options )
static unsigned GetOptions()
static void SetLevel(unsigned level )
static unsigned GetLevel()
static BOOL CanTrace(unsigned level)
static void SetStream(ostream * out )
static ostream& Begin( unsigned level, const char * fileName, int lineNum )
ostream & s = PTrace::Begin(3, __FILE__, __LINE__);
s << "hello";
if (want_there)
s << " there";
s << '!' << PTrace::End();
fileName - Filename of source file being traced
lineNum - Line number of source file being traced.static ostream& End(ostream & strm)
ostream & s = PTrace::Begin();
s << "hello";
if (want_there)
s << " there";
s << '!' << PTrace::End();
Alphabetic index HTML hierarchy of classes or Java