Protocol class
which defines the interface for all types of logger.
More...
#include <keyvalue/sys/logger/Logger.h>
Public Types | |
enum | Device { Console, File, Standard } |
Logger devices. More... | |
Public Member Functions | |
virtual unsigned int | getLevel () const =0 |
Gets Logger's current level. | |
virtual void | setLevel (unsigned int level)=0 |
Sets Logger's current level. | |
virtual bool | log (const Message &message)=0 |
Logs a Message. |
Protocol class
which defines the interface for all types of logger.
Each Logger and each Message (except those of type Error) has a verbosity level. If a Logger of level m receives a Message of level n with m > n, then the Message is processed by the Logger. Otherwise it is ignored. Therefore, a 0-level Logger ignores every Message.
On the other hand, a Message of type Error is never ignored.
virtual unsigned int getLevel | ( | ) | const [pure virtual] |
Gets Logger's current level.
Implemented in LoggerImpl< PrefixPolicy, ColourPolicy, SafetyPolicy >.
virtual void setLevel | ( | unsigned int | level | ) | [pure virtual] |
Sets Logger's current level.
level | : New level. |
Implemented in LoggerImpl< PrefixPolicy, ColourPolicy, SafetyPolicy >.
virtual bool log | ( | const Message & | message | ) | [pure virtual] |
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 >.