Implements an xterm console Logger. More...
#include "keyvalue/sys/logger/XtermConsole.h"
Classes | |
class | FileRaii |
XtermConsole's helper class for file management. More... | |
Public Types | |
typedef LoggerImpl< AddPrefix, XtermColor, ForwardToGlobalLogger > | LoggerImpl_ |
enum | Device { Console, File, Standard } |
Public Member Functions | |
XtermConsole (unsigned int level, const string &title) | |
unsigned int | getLevel () const |
Gets Logger's current level. | |
void | setLevel (unsigned int level) |
Sets Logger's current level. | |
bool | log (const Message &message) |
Logs a Message. | |
Protected Member Functions | |
bool | sendHeader () |
Sends the header message. | |
Private Member Functions | |
bool | send (const string &message) |
Sends a raw string message to the Logger's underlying device. | |
Private Attributes | |
unsigned int | level_ |
pid_t | childPid_ |
FileRaii | writeSlave_ |
Implements an xterm console Logger.
bool send | ( | const string & | message | ) | [private, virtual] |
Sends a raw string
message to the Logger's underlying device.
message | : Message to be sent. |
false
if it fails. Otherwise, it returns true
. Implements LoggerImpl< AddPrefix, XtermColor >.
unsigned int getLevel | ( | ) | const [virtual, inherited] |
void setLevel | ( | unsigned int | level | ) | [virtual, inherited] |
bool log | ( | const Message & | message | ) | [virtual, inherited] |
Logs a Message.
This method may fail if the implemented Logger cannot process the message (e.g. a console Logger that has no longer a console window).
message | : Message to be logged. |
true
if it is successful. Implements Logger.
bool sendHeader | ( | ) | [protected, inherited] |
Sends the header message.
This method sends (throw send()) an opening header message to the underlying device of the Logger.