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

utils::logging::listener Class Reference

a log listener receives log messages. More...

#include <log.h>

Inheritance diagram for utils::logging::listener::

utils::logging::ostream_listener utils::logging::file_listener List of all members.

Public Methods

 listener ()
 c'tor. More...

virtual ~listener ()
 d'tor. More...

virtual bool onMsg (const msg &msg)=0
 handles a individual message. More...


Protected Methods

void attach ()
 attachs the object within the main logger. More...

void detach ()
 detachs the object from the main logger. More...


Detailed Description

a log listener receives log messages.

It can do whatever it wants. Usually, the log listener formats the message for output and prints it somewhere.

 If you derive from this class make sure you call attach() after constructing (like at the end of your c'tor) and detach() before deconstructing (like at the beginning of your d'tor.)


Constructor & Destructor Documentation

utils::logging::listener::listener  
 

c'tor.

virtual utils::logging::listener::~listener   [virtual]
 

d'tor.


Member Function Documentation

void utils::logging::listener::attach   [protected]
 

attachs the object within the main logger.

after calling this method the object is registered within the logger, and log messages are handled by it.

void utils::logging::listener::detach   [protected]
 

detachs the object from the main logger.

after calling this method the object is unregistered from the logger, and log messages are no longer handled by it.

virtual bool utils::logging::listener::onMsg const msg   msg [pure virtual]
 

handles a individual message.

If this method returns false the message won't be handled any longer. As listener base objects are called in the order of creation you might use this to create simple message filters.

Reimplemented in utils::logging::ostream_listener.


The documentation for this class was generated from the following file:
Generated on Mon Oct 22 17:03:48 2001 for rfc822 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001