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

Log message handler that writes log messages a file. More...

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

Inheritance diagram for cppassist::FileLogHandler:
Inheritance graph
[legend]
Collaboration diagram for cppassist::FileLogHandler:
Collaboration graph
[legend]

Public Member Functions

 FileLogHandler (const std::string &logfile="logfile.log")
 Constructor. More...
 
virtual void handle (const LogMessage &message) override
 Handle log message. More...
 
- Public Member Functions inherited from cppassist::AbstractLogHandler
 AbstractLogHandler ()
 Constructor. More...
 
virtual ~AbstractLogHandler ()
 Destructor. More...
 

Protected Attributes

std::string m_logfile
 File name of the log file. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from cppassist::AbstractLogHandler
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

Log message handler that writes log messages a file.

See also
setLoggingHandler
logging.h

Constructor & Destructor Documentation

◆ FileLogHandler()

cppassist::FileLogHandler::FileLogHandler ( const std::string &  logfile = "logfile.log")

Constructor.

Parameters
[in]logfileFile name

Member Function Documentation

◆ handle()

virtual void cppassist::FileLogHandler::handle ( const LogMessage message)
overridevirtual

Handle log message.

Parameters
[in]messageLog message

Implements cppassist::AbstractLogHandler.

Member Data Documentation

◆ m_logfile

std::string cppassist::FileLogHandler::m_logfile
protected

File name of the log file.


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