verve::Logger Class Reference

This class is used to log any events, errors, or warnings that may come up. More...

#include <Logger.h>

List of all members.

Public Member Functions

void VERVE_CALL setStream (const std::string &name, std::ostream *stream, const std::string &prefix="", char mark='\0')
std::ostream &VERVE_CALL stream (const std::string &name)

Static Public Member Functions

static Logger &VERVE_CALL instance ()

Private Member Functions

 Logger ()
 ~Logger ()

Private Attributes

std::map< std::string, StreammStreams

Classes

struct  Stream
 A simple output stream structure. More...


Detailed Description

This class is used to log any events, errors, or warnings that may come up.

Calls to this class should replace all cout << statements in the form: Logger::stream("myStreamName") << ... where myStreamName was registered as a cout stream or file stream using the setStream function. We use a singleton here so we never have to initialize the Logger explicitly.

Definition at line 50 of file Logger.h.


Constructor & Destructor Documentation

verve::Logger::Logger  )  [inline, private]
 

Definition at line 93 of file Logger.h.

verve::Logger::~Logger  )  [inline, private]
 

Definition at line 100 of file Logger.h.


Member Function Documentation

static Logger& VERVE_CALL verve::Logger::instance  )  [inline, static]
 

Returns a reference to the singleton.

Definition at line 54 of file Logger.h.

void VERVE_CALL verve::Logger::setStream const std::string &  name,
std::ostream *  stream,
const std::string &  prefix = "",
char  mark = '\0'
[inline]
 

Register a new stream for later use.

Definition at line 61 of file Logger.h.

References verve::Logger::Stream::mark, mStreams, verve::Logger::Stream::prefix, verve::Logger::Stream::silent, and verve::Logger::Stream::stream.

std::ostream& VERVE_CALL verve::Logger::stream const std::string &  name  )  [inline]
 

Returns the named stream.

Definition at line 74 of file Logger.h.

References verve::Logger::Stream::mark, mStreams, verve::Logger::Stream::prefix, and verve::Logger::Stream::stream.


Member Data Documentation

std::map<std::string, Stream> verve::Logger::mStreams [private]
 

Internal map of named output streams.

Definition at line 115 of file Logger.h.

Referenced by setStream(), and stream().


The documentation for this class was generated from the following file:
Generated on Tue Jan 24 21:46:39 2006 for Verve by  doxygen 1.4.6-NO