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

Representation of a log message. More...

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

Public Types

enum  Level {
  Critical, Error, Warning, Info,
  Debug
}
 Log level. More...
 

Public Member Functions

 LogMessage (int level, const std::string &message, const std::string &context)
 Constructor. More...
 
int level () const
 Get log level of the message. More...
 
const std::string & message () const
 Get log message. More...
 
const std::string & context () const
 Get context of the log message. More...
 

Protected Attributes

int m_level
 Log level. More...
 
std::string m_message
 Log message. More...
 
std::string m_context
 User defined context string. More...
 

Detailed Description

Representation of a log message.

LogMessages are handled and dispatched by the global logging handler which has to be a subclass of AbstractLogHandler.

See also
logging.h
AbstractLogHandler

Member Enumeration Documentation

◆ Level

Log level.

Enumerator
Critical 

Cricical errors.

Error 

Errors.

Warning 

Warnings.

Info 

Info messages.

Debug 

Debug messages (Use Debug + x for further debug levels)

Constructor & Destructor Documentation

◆ LogMessage()

cppassist::LogMessage::LogMessage ( int  level,
const std::string &  message,
const std::string &  context 
)

Constructor.

Parameters
[in]levelLog level
[in]messageLog message
[in]contextUser defined context string

Member Function Documentation

◆ level()

int cppassist::LogMessage::level ( ) const

Get log level of the message.

Returns
Log level

◆ message()

const std::string& cppassist::LogMessage::message ( ) const

Get log message.

Returns
Log message

◆ context()

const std::string& cppassist::LogMessage::context ( ) const

Get context of the log message.

Returns
User defined context string

Member Data Documentation

◆ m_level

int cppassist::LogMessage::m_level
protected

Log level.

◆ m_message

std::string cppassist::LogMessage::m_message
protected

Log message.

◆ m_context

std::string cppassist::LogMessage::m_context
protected

User defined context string.


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