CachedLogger Class Reference

A Logger object that filters duplicate messages. More...

#include <cached_logger.hpp>

Inheritance diagram for CachedLogger:

LoggerInterface List of all members.

Public Member Functions

 CachedLogger (LoggerInterface const &previous_logger)
virtual ~CachedLogger ()
virtual void log (std::string const &msg, LoggerLevel level) const
 Write a log message.
virtual void error (std::string const &msg) const
 Write an error to a Logger for immediate output.
void flush () const
 Flush the message cache.

Detailed Description

A Logger object that filters duplicate messages.

A CachedLogger stores all incoming messages, and writes one copy of each identical message to the previous Logger object in the global stack when the CachedLogger is destroyed, or when the flush() method is invoked.


Constructor & Destructor Documentation

CachedLogger ( LoggerInterface const &  previous_logger  ) 

virtual ~CachedLogger (  )  [virtual]


Member Function Documentation

void log ( std::string const &  msg,
LoggerLevel  level 
) const [virtual]

Write a log message.

This message will be cached and filtered for uniqueness. For immediate output, use the Logger::error() method.

Implements LoggerInterface.

virtual void error ( std::string const &  msg  )  const [virtual]

Write an error to a Logger for immediate output.

A message passed to this method will be bypass all filtering/caching mechanisms. Use judiciously.

Implements LoggerInterface.

void flush (  )  const

Flush the message cache.

Writes every message in the message cache to the previous Logger object in the stack.


The documentation for this class was generated from the following files:
Generated on Sun Jul 15 20:46:36 2007 for BTK Core by  doxygen 1.5.1