Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

LobTraceStream Class Reference

Trace message to be logged. More...

#include <lobtracestream.h>

Inheritance diagram for LobTraceStream::

LobTraceStreamQt List of all members.

Public Methods

 LobTraceStream (LobTraceProvider *tp=&g_lobTraceProvider)
const char * getTraceOutput ()
bool getXmlTraceOutput (const char *srcString, char *xmlString, const int len)
 Returns the trace in XML format. More...

int getContextModule ()
int getContextLevel ()
int getContextLine ()
const char * getContextFile ()
LobTraceProvidergetTraceProvider ()
void setContextInfo (int module, int level, const char *file, int line)
 Set trace info needed by the LobTraceProvider. More...

void setTraceProvider (LobTraceProvider *tp)
 Specify to which LobTraceProvider the trace buffer will be flushed. More...

LobTraceStream & operator<< (const int &param)
 concatenates an integer to the trace buffer. More...

LobTraceStream & operator<< (const char *param)
 concatenates a char* to the trace buffer. More...

LobTraceStream & operator<< (const double &param)
 concatenates a double to the trace buffer. More...

LobTraceStream & operator<< (LobTraceStreamEnd &param)
 this is the trigger that will write the buffer to the stream. More...

void traceException (int type=0, const char *msg=NULL)
 writes a formated exception to the stream. More...

virtual void dump ()
 writes a complete XML description of this instance to cout. More...


Protected Attributes

char m_bufferString [BUFFERSTRING_SIZE]
LobTraceProviderm_pTraceProvider

Friends

ostream & operator<< (ostream &os, LobTraceStream &lts)
 Provides a brief description of this LobTraceStream instance. More...


Detailed Description

Trace message to be logged.

A LobTraceStream will help the user to construct a trace message.
Basicaly the LobTraceStream holds 3 major information: the message text, the module it belongs to, and the traceLevel.

The LobTraceStream will then be sent to the LobTraceProvider in order to be logged in an output stream (file/cout/other)


Constructor & Destructor Documentation

LobTraceStream::LobTraceStream LobTraceProvider   tp = &g_lobTraceProvider
 


Member Function Documentation

void LobTraceStream::dump   [virtual]
 

writes a complete XML description of this instance to cout.

Reimplemented in LobTraceStreamQt.

const char* LobTraceStream::getContextFile   [inline]
 

int LobTraceStream::getContextLevel   [inline]
 

int LobTraceStream::getContextLine   [inline]
 

int LobTraceStream::getContextModule   [inline]
 

const char* LobTraceStream::getTraceOutput   [inline]
 

LobTraceProvider* LobTraceStream::getTraceProvider   [inline]
 

bool LobTraceStream::getXmlTraceOutput const char *    srcString,
char *    xmlString,
const int    len
 

Returns the trace in XML format.

Some characters like " or ' are not valid in XML and must first be replaced by XML tags.
This methods returns a copy of the internal buffer, but with those XML tags.

Parameters:
xmlString  IN The string to be processed
xmlString  OUT an ALREADY ALLOCATED result string that must at least be as long as m_bufferString. (that is: BUFFERSTRING_SIZE)
len  IN xmlString length
Returns:
'true' if string correctly converted.
'false' if truncated, or wrong params

LobTraceStream & LobTraceStream::operator<< LobTraceStreamEnd   param
 

this is the trigger that will write the buffer to the stream.

Parameters:
LobTraceStreamEnd  & IN any LobTraceStreamEnd instance.

Reimplemented in LobTraceStreamQt.

LobTraceStream & LobTraceStream::operator<< const double &    param
 

concatenates a double to the trace buffer.

Parameters:
param  IN double to be traced
Note:
No output if buffer overflow (BUFFERSTRING_SIZE)

Reimplemented in LobTraceStreamQt.

LobTraceStream & LobTraceStream::operator<< const char *    param
 

concatenates a char* to the trace buffer.

Parameters:
param  IN string to be traced
Note:
Truncated output if buffer overflow (BUFFERSTRING_SIZE)

Reimplemented in LobTraceStreamQt.

LobTraceStream & LobTraceStream::operator<< const int &    param
 

concatenates an integer to the trace buffer.

Parameters:
param  IN integer to be traced
Note:
No output if buffer overflow (BUFFERSTRING_SIZE)

Reimplemented in LobTraceStreamQt.

void LobTraceStream::setContextInfo int    module,
int    level,
const char *    file,
int    line
 

Set trace info needed by the LobTraceProvider.

Sets context info that will be used by LobTraceProvider when formating & printing the message.
this is to be used before each new trace. (see LOB_TRACE macro)

Parameters:
module  IN module this trace belongs to.
level  IN traceLevel
file  IN __FILE__
line  IN __LINE__

void LobTraceStream::setTraceProvider LobTraceProvider   tp
 

Specify to which LobTraceProvider the trace buffer will be flushed.

Parameters:
tp  IN pointer to a LobTraceProvider

void LobTraceStream::traceException int    type = 0,
const char *    msg = NULL
 

writes a formated exception to the stream.

Note:
Truncated output if buffer overflow (BUFFERSTRING_SIZE)


Friends And Related Function Documentation

ostream& operator<< ostream &    os,
LobTraceStream &    lts
[friend]
 

Provides a brief description of this LobTraceStream instance.


Member Data Documentation

char LobTraceStream::m_bufferString[BUFFERSTRING_SIZE] [protected]
 

LobTraceProvider* LobTraceStream::m_pTraceProvider [protected]
 


The documentation for this class was generated from the following files:
Generated on Sun Dec 15 23:17:21 2002 for LobTraceStream by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001