![]() |
cppassist
1.0.0.f4fab4f962ff
C++ sanctuary for small but powerful and frequently required, stand alone features.
|
Abstract log message handler. More...
#include <cppassist/include/cppassist/logging/AbstractLogHandler.h>
Public Member Functions | |
AbstractLogHandler () | |
Constructor. More... | |
virtual | ~AbstractLogHandler () |
Destructor. More... | |
virtual void | handle (const LogMessage &message)=0 |
Handle log message. More... | |
Static Protected Member Functions | |
static std::string | messagePrefix (const LogMessage &message) |
Construct prefix from message context. More... | |
static std::string | levelString (int level) |
Construct string denoting log level. More... | |
Abstract log message handler.
cppassist uses a global logging handler to which all generated log messages are dispatched. This is the abstract interface for handling them. Subclass this class if you wish to replace the global default logging behavior in cppassist, which is to write everything to stdout.
cppassist::AbstractLogHandler::AbstractLogHandler | ( | ) |
Constructor.
|
virtual |
Destructor.
|
pure virtual |
Handle log message.
[in] | message | Log message |
Implemented in cppassist::FileLogHandler, and cppassist::ConsoleLogHandler.
|
staticprotected |
Construct prefix from message context.
[in] | message | Log message |
|
staticprotected |
Construct string denoting log level.
[in] | level | Log level |