cppassist  1.0.0.f4fab4f962ff
C++ sanctuary for small but powerful and frequently required, stand alone features.
Public Member Functions | Static Protected Member Functions | List of all members
cppassist::AbstractLogHandler Class Referenceabstract

Abstract log message handler. More...

#include <cppassist/include/cppassist/logging/AbstractLogHandler.h>

Inheritance diagram for cppassist::AbstractLogHandler:
Inheritance graph
[legend]

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...
 

Detailed Description

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.

See also
setLoggingHandler
logging.h

Constructor & Destructor Documentation

◆ AbstractLogHandler()

cppassist::AbstractLogHandler::AbstractLogHandler ( )

Constructor.

◆ ~AbstractLogHandler()

virtual cppassist::AbstractLogHandler::~AbstractLogHandler ( )
virtual

Destructor.

Member Function Documentation

◆ handle()

virtual void cppassist::AbstractLogHandler::handle ( const LogMessage message)
pure virtual

Handle log message.

Parameters
[in]messageLog message

Implemented in cppassist::FileLogHandler, and cppassist::ConsoleLogHandler.

◆ messagePrefix()

static std::string cppassist::AbstractLogHandler::messagePrefix ( const LogMessage message)
staticprotected

Construct prefix from message context.

Parameters
[in]messageLog message
Returns
Prefix

◆ levelString()

static std::string cppassist::AbstractLogHandler::levelString ( int  level)
staticprotected

Construct string denoting log level.

Parameters
[in]levelLog level
Returns
String denoting log level

The documentation for this class was generated from the following file: