Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

LogSource Class Reference

#include <logstream.h>

Collaboration diagram for LogSource:

Collaboration graph
[legend]
List of all members.

Detailed Description

The log source object Contains a loglevel state and a number of data sinks for logging output, each with a loglevel threshold. When it is given output to log, it gives that output to all sinks that will accept logs equal to the current loglevel state or higher. For an example, look at the documentation for the logstream.h file.

Author:
Cody Russell (cody jhu edu)


Public Member Functions

 LogSource ()
void AttachSink (LogSink *pkSink)
void DetachSink (LogSink *pkSink)
void Write (const std::string &rstrMsg)
void SetLogLevel (unsigned int uiLevel)
unsigned int GetLogLevel ()
void PushLogLevel (unsigned int uiLevel)
void PopLogLevel ()
void SetLogThreshold (unsigned int uiLevel)
void SetErrorCallback (LogErrorCallback *pkCallback)

Protected Attributes

LogSourceStreamBuf m_kStreamBuf
std::vector< LogSink * > m_vpkSinks
unsigned int m_uiLogLevel
unsigned int m_uiThreshold
LogErrorCallbackm_pkErrorCallback
std::vector< unsigned int > m_vuiLogLevelStack


Constructor & Destructor Documentation

LogSource  ) 
 


Member Function Documentation

void AttachSink LogSink pkSink  ) 
 

Attach a data sink to this source

Parameters:
pkSink The sink to attach

void DetachSink LogSink pkSink  ) 
 

Detach a data sink from this source

Parameters:
pkSink The sink to detach

void Write const std::string &  rstrMsg  ) 
 

Writes data to each data sink

Parameters:
rstrMsg Data to be written

void SetLogLevel unsigned int  uiLevel  ) 
 

Set current log level

Parameters:
uiLevel Log level

unsigned int GetLogLevel  )  [inline]
 

Returns:
Current log level

void PushLogLevel unsigned int  uiLevel  ) 
 

Push the current log level on the stack and set new level

Parameters:
uiLevel New log level

void PopLogLevel  ) 
 

Pop the and restore current log level from the stack

void SetLogThreshold unsigned int  uiLevel  ) 
 

Set log threshold

Parameters:
uiLevel Threshold level (all levels less severe will be ignored)

void SetErrorCallback LogErrorCallback pkCallback  ) 
 

Set error callback method

Parameters:
pkCallback Error callback object


Member Data Documentation

LogSourceStreamBuf m_kStreamBuf [protected]
 

Our stream buffer

std::vector< LogSink* > m_vpkSinks [protected]
 

List of all data sinks

unsigned int m_uiLogLevel [protected]
 

The current loglevel for the source

unsigned int m_uiThreshold [protected]
 

Current log threshold

LogErrorCallback* m_pkErrorCallback [protected]
 

Error callback

std::vector< unsigned int > m_vuiLogLevelStack [protected]
 

Loglevel stack


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:11 2004 for NeoEngine by doxygen 1.3.5