|
libpsynth 0.2.1
|
A logger node. More...
#include <logger.hpp>


Public Types | |
| enum | level { debug, info, warning, error, fatal } |
| The message relevance. More... | |
Public Member Functions | |
| log () | |
| Constructor. | |
| ~log () | |
| Destructor. | |
| void | add_sink (log_sink_ptr d) |
| Attachs a sink to this node. | |
| void | del_sink (log_sink_ptr d) |
| Dettachs a sink from this node. | |
| void | operator() (const std::string &child, int level, const std::string &msg) |
| Logs a message in a child of this node and all its parents. | |
| void | operator() (int level, const std::string &msg) |
| Log a message into this node. | |
| log_stream_adapter_wrapper | stream () |
| Returns a stream object that can be used to send messages to the log in a iostreams fashion. | |
Static Public Member Functions | |
| static const char * | level_name (int level) |
| Returns a string version of each level name. | |
A logger node.
The log structure is actually a tree so log messages can be categorized hierarchically. When a message its logged, the message is propagated by all the log parents so, for example, you can set up your sinks the root node if you want to listen for all messages.
The message relevance.
| psynth::base::log::log | ( | ) | [inline] |
Constructor.
| psynth::base::log::~log | ( | ) |
Destructor.
| void psynth::base::log::add_sink | ( | log_sink_ptr | d | ) |
Attachs a sink to this node.
| d | The sink that we want to dump this log's messages. |
| void psynth::base::log::del_sink | ( | log_sink_ptr | d | ) |
Dettachs a sink from this node.
| d | The sink we don't want to dump massages of this log anymore. |
| static const char* psynth::base::log::level_name | ( | int | level | ) | [inline, static] |
Returns a string version of each level name.
| level | The level of which we want to now its string name. |
| void psynth::base::log::operator() | ( | const std::string & | child, |
| int | level, | ||
| const std::string & | msg | ||
| ) | [inline] |
Logs a message in a child of this node and all its parents.
| child | The child in which we want to log the message. |
| level | The relevance of this message. |
| msg | The message to log. |
| void psynth::base::log::operator() | ( | int | level, |
| const std::string & | msg | ||
| ) | [inline] |
Log a message into this node.
| level | The relevance of this message. |
| msg | The message to log. |
| log_stream_adapter_wrapper psynth::base::log::stream | ( | ) | [inline] |
Returns a stream object that can be used to send messages to the log in a iostreams fashion.
1.7.4