#include <log.h>
Inheritance diagram for utils::logging::listener::
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... |
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.)
|
c'tor.
|
|
d'tor.
|
|
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. |
|
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. |
|
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. |