This simple class is to handle the log file. More...
#include <DcLogger.h>
Public Member Functions | |
CdcLogger () | |
Constructor - Takes the Log Level and Log Period from the configuration file. | |
virtual | ~CdcLogger () |
Destructor - Just close the log file. | |
void | PrintString (CdcString str, int level, bool console) |
This function prints a string to the log file. | |
void | Init () |
I have To initialize the class after I initialize CdcParameters. |
This simple class is to handle the log file.
It logs data according to the Log Level setting in the configuration file. It replaces the log file every day, week, month or never, also according to the Log configuration. The class prints to a file, and if the application is running in console mode, it prints to the console as well. It does not prints to the console the Requests data though.
Definition at line 55 of file DcLogger.h.
CdcLogger::CdcLogger | ( | ) | [inline] |
Constructor - Takes the Log Level and Log Period from the configuration file.
Definition at line 92 of file DcLogger.h.
virtual CdcLogger::~CdcLogger | ( | ) | [inline, virtual] |
Destructor - Just close the log file.
Definition at line 98 of file DcLogger.h.
void CdcLogger::Init | ( | ) |
I have To initialize the class after I initialize CdcParameters.
but if CdcParameters fails to read the configuration files, I still need to be able to print a message on the console. So the constructor just makes this class ready to print general messages to the console, and this function does the rest of the initialization.
Definition at line 91 of file DcLogger.cpp.
void CdcLogger::PrintString | ( | CdcString | str, |
int | level, | ||
bool | console | ||
) |
This function prints a string to the log file.
str | The string to print. |
level | The Log Level of this string. It will not print the string if the level is higher the the general Log Level. |
console | True if the application is running in a console mode. |
Definition at line 73 of file DcLogger.cpp.