PPL Assignment
IRM2015006
Logger Class Reference

#include <logger.h>

Collaboration diagram for Logger:
Collaboration graph

Public Member Functions

 Logger (const std::string filename)
 
void info (const std::string msg, bool print=false)
 
void log (const std::string type, const std::string msg, bool print=false)
 
 ~Logger ()
 

Private Attributes

time_t rawtime
 
std::string tmpstr
 
std::fstream file
 

Detailed Description

< Class for logger

Definition at line 8 of file logger.h.

Constructor & Destructor Documentation

Logger::Logger ( const std::string  filename)

Constructor with filename of log file as parameter

Definition at line 8 of file logger.cpp.

Logger::~Logger ( )

Destructor which closes file on invokation

Definition at line 44 of file logger.cpp.

Member Function Documentation

void Logger::info ( const std::string  msg,
bool  print = false 
)

Method to log single line statements
print = true prints it to stdout also

Definition at line 18 of file logger.cpp.

Here is the caller graph for this function:

void Logger::log ( const std::string  type,
const std::string  msg,
bool  print = false 
)

Method to log with type and detailed message
print = true prints it to stdout also

Definition at line 27 of file logger.cpp.

Here is the caller graph for this function:

Member Data Documentation

std::fstream Logger::file
private

File stream to the log file

Definition at line 13 of file logger.h.

time_t Logger::rawtime
private

Helper variable for time manipulation

Definition at line 11 of file logger.h.

std::string Logger::tmpstr
private

Helper variable for string manipulation

Definition at line 12 of file logger.h.


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