Class LogFile

Class Documentation

class LogFile

Contains routines for writing to log files.

Public Functions

LogFile()

Default constructor.

LogFile(string file_name_in)

Constructor taking location of a log file.

Parameters
  • file_name_in: the path to the log file to open

~LogFile()

Default destructor, including writing closure out to log file.

void init(string file_name_in)

Initialises the LogFile by creating a file at the specified location.

Parameters
  • file_name_in: the file to create

void write(const int &level, string message)

Writes the message out to the logfile at the specified logging level.

Parameters
  • level: the level of logging severity
  • message: the message to write out

void write(const int &level, stringstream &message)

Writes the message out to the logfile at the specified logging level.

Parameters
  • level: the level of logging severity
  • message: the message to write out

Protected Functions

LogFile(const LogFile&)
LogFile &operator=(const LogFile&)

Protected Attributes

ofstream output_stream
string file_name
map<int, string> levels_map