#include <rlog/StdioNode.h>
Inheritance diagram for rlog::StdioNode:

Public Member Functions | |
| StdioNode (int fdOut=2, bool colorize_if_tty=true) | |
| void | subscribeTo (RLogNode *node) |
| StdioNode (int fdOut=2, bool colorize_if_tty=true) | |
| void | subscribeTo (RLogNode *node) |
Protected Member Functions | |
| virtual void | publish (const RLogData &data) |
| Publish data. | |
| StdioNode (const StdioNode &) | |
| StdioNode & | operator= (const StdioNode &) |
| virtual void | publish (const RLogData &data) |
| Publish data. | |
| StdioNode (const StdioNode &) | |
| StdioNode & | operator= (const StdioNode &) |
Protected Attributes | |
| bool | colorize |
| int | fdOut |
This displays all subscribed messages to a file descriptor. If the output is a terminal, then the messages are colorized (yellow for warnings, red for errors).
For example, to log to stderr:
int main(int argc, char **argv) { // tell RLog the program name.. RLog_Init( argv[0] ); // log to standard error StdioNode stdlog( STDERR_FILENO ); // show all warning and error messages, no matter what component they // come from. stdlog.subscribeTo( GetGlobalChannel( "warning" )); stdlog.subscribeTo( GetGlobalChannel( "error" )); }
RLOG_CHANNEL()
|
||||||||||||
|
|
|
|
Publish data. This iterates over the list of subscribers which have stated interest and sends them the data. Reimplemented from rlog::RLogNode.
|
|
|
Publish data. This iterates over the list of subscribers which have stated interest and sends them the data. Reimplemented from rlog::RLogNode.
|
|
|
Subscribe to log messages. Example: StdioNode log( STDERR_FILENO ); // subscribe to error and warning messages log.subscribeTo( GetGlobalChannel("error" )); log.subscribeTo( RLOG_CHANNEL("warning" )); |
1.3.8