Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

zeitgeist::LogServer Class Reference

The log server is responsible for holding a bunch of ostreams, which data can be streamed to. More...

#include <logserver.h>

Inheritance diagram for zeitgeist::LogServer:

Inheritance graph
[legend]
Collaboration diagram for zeitgeist::LogServer:

Collaboration graph
[legend]
List of all members.

Public Types

enum  EPriorityLevel {
  eNone = 0, eDebug = 1, eNormal = 2, eWarning = 4,
  eError = 8, eAll = 0xffffffff
}
 defines different priority levels assigned to a log message. More...

Public Member Functions

 LogServer (unsigned int size=1024)
 constructs a logserver with a an internal stream buffer of size
virtual ~LogServer ()
void AddStream (std::ostream *stream, unsigned int mask=eAll)
 adds a stream to the list of streams.
bool RemoveStream (const std::ostream *stream)
 removes a stream from the list of streams.
bool SetPriorityMask (const std::ostream *stream, unsigned int mask)
 sets the priority mask of a stream in the list.
unsigned int GetPriorityMask (const std::ostream *stream) const
 gets priority mask of a stream in the list.
LogServerPriority (unsigned int prio)
 selects the priority for the messages to be written.
LogServerDebug ()
 selects the debug priority and returns a reference to this logserver
LogServerNormal ()
 selects the normal priority and returns a reference to this logserver
LogServerWarning ()
 selects the warning priority and returns a reference to this logserver
LogServerError ()
 selects the error priority and returns a reference to this logserver
void Printf (const char *inFormat,...)
 provides an printf-style interface.

Private Member Functions

 LogServer (const LogServer &obj)
LogServeroperator= (const LogServer &obj)
const LogServerStreamBufGetStreamBuf () const
LogServerStreamBufGetStreamBuf ()

Detailed Description

The log server is responsible for holding a bunch of ostreams, which data can be streamed to.

It is THE logging facility used within zeitgeist.

Definition at line 45 of file logserver.h.


Member Enumeration Documentation

enum zeitgeist::LogServer::EPriorityLevel
 

defines different priority levels assigned to a log message.

The values are designed as a bitmap and can be combined, to trigger different filters

Enumerator:
eNone 
eDebug 
eNormal 
eWarning 
eError 
eAll 

Definition at line 54 of file logserver.h.


Constructor & Destructor Documentation

LogServer::LogServer unsigned int  size = 1024  ) 
 

constructs a logserver with a an internal stream buffer of size

Definition at line 29 of file logserver.cpp.

LogServer::~LogServer  )  [virtual]
 

Definition at line 34 of file logserver.cpp.

zeitgeist::LogServer::LogServer const LogServer obj  )  [private]
 


Member Function Documentation

void LogServer::AddStream std::ostream *  stream,
unsigned int  mask = eAll
 

adds a stream to the list of streams.

First, it is checked if the stream is already in. If the stream is found, we only install a new priority mask, so no stream can be added twice.

Parameters:
stream the stream to add
mask the (new) priority mask for the stream

Definition at line 42 of file logserver.cpp.

References zeitgeist::LogServerStreamBuf::AddStream(), and GetStreamBuf().

Here is the call graph for this function:

LogServer& zeitgeist::LogServer::Debug  )  [inline]
 

selects the debug priority and returns a reference to this logserver

Definition at line 112 of file logserver.h.

References eDebug, and Priority().

Here is the call graph for this function:

LogServer& zeitgeist::LogServer::Error  )  [inline]
 

selects the error priority and returns a reference to this logserver

Definition at line 124 of file logserver.h.

References eError, and Priority().

Here is the call graph for this function:

unsigned int LogServer::GetPriorityMask const std::ostream *  stream  )  const
 

gets priority mask of a stream in the list.

Parameters:
stream the stream for which we want to set the priority mask
Returns:
the priority mask; 0 if stream was not found

Definition at line 52 of file logserver.cpp.

References zeitgeist::LogServerStreamBuf::GetPriorityMask(), and GetStreamBuf().

Here is the call graph for this function:

LogServerStreamBuf & LogServer::GetStreamBuf  )  [private]
 

Definition at line 90 of file logserver.cpp.

const LogServerStreamBuf & LogServer::GetStreamBuf  )  const [private]
 

Definition at line 84 of file logserver.cpp.

Referenced by AddStream(), GetPriorityMask(), Priority(), RemoveStream(), and SetPriorityMask().

LogServer& zeitgeist::LogServer::Normal  )  [inline]
 

selects the normal priority and returns a reference to this logserver

Definition at line 116 of file logserver.h.

References eNormal, and Priority().

Here is the call graph for this function:

LogServer& zeitgeist::LogServer::operator= const LogServer obj  )  [private]
 

void LogServer::Printf const char *  inFormat,
  ...
 

provides an printf-style interface.

Definition at line 69 of file logserver.cpp.

LogServer & LogServer::Priority unsigned int  prio  ) 
 

selects the priority for the messages to be written.

It returns a reference to this logserver instance, allowing multiple priority changes in one stream expression, e.g. log << Priority(eNormal) << "normal msg" << Priority(eDbug) << "debug msg"

Definition at line 62 of file logserver.cpp.

References GetStreamBuf(), and zeitgeist::LogServerStreamBuf::SetCurrentPriority().

Referenced by Debug(), Error(), Normal(), and Warning().

Here is the call graph for this function:

bool LogServer::RemoveStream const std::ostream *  stream  ) 
 

removes a stream from the list of streams.

Parameters:
stream the stream to remove
Returns:
true if the stream was found (and thus removed)

Definition at line 47 of file logserver.cpp.

References GetStreamBuf(), and zeitgeist::LogServerStreamBuf::RemoveStream().

Here is the call graph for this function:

bool LogServer::SetPriorityMask const std::ostream *  stream,
unsigned int  mask
 

sets the priority mask of a stream in the list.

Parameters:
stream the stream for which we want to set the priority mask
mask the new priority mask
Returns:
true if the stream was found

Definition at line 57 of file logserver.cpp.

References GetStreamBuf(), and zeitgeist::LogServerStreamBuf::SetPriorityMask().

Here is the call graph for this function:

LogServer& zeitgeist::LogServer::Warning  )  [inline]
 

selects the warning priority and returns a reference to this logserver

Definition at line 120 of file logserver.h.

References eWarning, and Priority().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:50:26 2006 for rcssserver3d by  doxygen 1.4.4