This class
implements a Windows console Logger.
More...
#include <keyvalue/sys/logger/WindowsConsole.h>
Public Types | |
typedef LoggerImpl < keyvalue::logger::AddPrefix, keyvalue::logger::XtermColour, keyvalue::logger::ForwardToGlobalLogger > | MyBase_ |
typedef LoggerImpl< AddPrefix, XtermColour, ForwardToGlobalLogger > | LoggerImpl_ |
enum | Device { Console, File, Standard } |
Logger devices. More... | |
Public Member Functions | |
WindowsConsole (unsigned int level, const string &title, const string &path) | |
unsigned int | getLevel () const |
virtual unsigned int | getLevel () const =0 |
Gets Logger's current level. | |
void | setLevel (unsigned int level) |
virtual void | setLevel (unsigned int level)=0 |
Sets Logger's current level. | |
bool | log (const Message &message) |
virtual bool | log (const Message &message)=0 |
Logs a Message. | |
Protected Member Functions | |
bool | sendHeader () |
Sends the header message. | |
virtual bool | send (const string &message)=0 |
virtual bool | send (const string &message)=0 |
Private Member Functions | |
bool | send (const string &message) |
Sends a raw string message to the Logger's underlying device. | |
Private Attributes | |
HANDLE | childStdInWrite_ |
PROCESS_INFORMATION | childProcess_ |
This class
implements a Windows 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, XtermColour, ForwardToGlobalLogger >.
virtual unsigned int getLevel | ( | ) | const [pure virtual, inherited] |
Gets Logger's current level.
Implemented in LoggerImpl< PrefixPolicy, ColourPolicy, SafetyPolicy >.
virtual void setLevel | ( | unsigned int | level | ) | [pure virtual, inherited] |
Sets Logger's current level.
level | : New level. |
Implemented in LoggerImpl< PrefixPolicy, ColourPolicy, SafetyPolicy >.
virtual bool log | ( | const Message & | message | ) | [pure 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. Implemented in LoggerImpl< PrefixPolicy, ColourPolicy, SafetyPolicy >.
bool sendHeader | ( | ) | [protected, inherited] |
Sends the header message.
This method sends (throw send()) an opening header message to the underlying device of the Logger.