Public Member Functions | List of all members
ime::utility::DiskFileLogger Class Reference

Utility class for logging messages to a file on the disk. More...

#include <DiskFileLogger.h>

Inheritance diagram for ime::utility::DiskFileLogger:
ime::utility::ILogger

Public Member Functions

 DiskFileLogger (const std::string &path, const std::string &filename)
 Constructor. More...
 
void setPath (const std::string &path)
 Set the path to the file where messages are logged. More...
 
const std::string & getPath () const
 Get the path to the file used for writing log messages. More...
 
void setFile (const std::string &filename)
 Set the file where messages are logged. More...
 
const std::string & getFile () const
 Get the name of the file used for writing log messages. More...
 
std::string getFullPath () const
 Get the full path to the file used for writing log messages. More...
 
void log (MessageType messageType, const std::string &msg) override
 Log message to a file on the disk. More...
 

Detailed Description

Utility class for logging messages to a file on the disk.

Definition at line 36 of file DiskFileLogger.h.

Constructor & Destructor Documentation

◆ DiskFileLogger()

ime::utility::DiskFileLogger::DiskFileLogger ( const std::string &  path,
const std::string &  filename 
)

Constructor.

Parameters
pathpath to the file where messages are logged
filenameName of the file where log messages are written

Member Function Documentation

◆ getFile()

const std::string & ime::utility::DiskFileLogger::getFile ( ) const

Get the name of the file used for writing log messages.

Returns
The name of the file used for writing log messages

◆ getFullPath()

std::string ime::utility::DiskFileLogger::getFullPath ( ) const

Get the full path to the file used for writing log messages.

Returns
The full path to the file used for writing log messages

The full path includes the path and the name in the form : path/filename

◆ getPath()

const std::string & ime::utility::DiskFileLogger::getPath ( ) const

Get the path to the file used for writing log messages.

Returns
The path t the file used for writing log messages

◆ log()

void ime::utility::DiskFileLogger::log ( MessageType  messageType,
const std::string &  msg 
)
overridevirtual

Log message to a file on the disk.

Parameters
messageTypeLog message type
msgMessage to be logged

This function will precede the log message with the date and time when the message was logged and message type.

Implements ime::utility::ILogger.

◆ setFile()

void ime::utility::DiskFileLogger::setFile ( const std::string &  filename)

Set the file where messages are logged.

Parameters
filenameName of the file where log messages are written

◆ setPath()

void ime::utility::DiskFileLogger::setPath ( const std::string &  path)

Set the path to the file where messages are logged.

Parameters
pathPath to the file where messages are logged

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