#include <spdLogger.h>
Public Member Functions | |
void | setLogFile (std::string filename) |
changes the log file | |
std::string | getLogFile () |
returns the current file name | |
int | log (std::string msg) |
log to everything using a string as input | |
int | logToFile (std::string msg) |
Logs to screen and to file but not to DIM. | |
int | log (const char *format,...) |
logs to everything using a C type string | |
int | logToScr (const char *format,...) |
Logs to screen only, not to file nor to DIM. | |
int | logToDim (const char *format,...) |
Logs to DIM and screen, not to file. | |
int | logToFile (const char *format,...) |
logs to file and to screen and not to DIM | |
void | deleteLogFile () |
deletes the logfile | |
void | setDimServiceName (const char *serviceName) |
set the DIM service log name | |
void | restartLogFile () |
renames the old log file and restarts the a clean file | |
~spdLogger (void) | |
Static Public Member Functions | |
static spdLogger & | getInstance () |
static function to get the only instance of the software | |
Protected Member Functions | |
spdLogger (void) | |
Private Member Functions | |
void | formatTime (char *time) |
function to format time | |
Private Attributes | |
std::string | logFile |
String containing the file name. | |
DimService * | logService |
dim service logging channel | |
char | logMsg [2000] |
the log message | |
std::ofstream | outfile |
the handle for the output file |
its an simple class loggin class its a singleton, can log to screen (cout), file and DIM Keeps the handle of the file at all time.
spdLogger::spdLogger | ( | void | ) | [protected] |
spdLogger::~spdLogger | ( | void | ) |
void spdLogger::formatTime | ( | char * | time | ) | [private] |
function to format time
spdLogger & spdLogger::getInstance | ( | ) | [static] |
static function to get the only instance of the software
void spdLogger::setLogFile | ( | std::string | filename | ) |
changes the log file
std::string spdLogger::getLogFile | ( | ) | [inline] |
returns the current file name
int spdLogger::log | ( | std::string | msg | ) |
log to everything using a string as input
int spdLogger::logToFile | ( | std::string | msg | ) |
Logs to screen and to file but not to DIM.
int spdLogger::log | ( | const char * | format, | |
... | ||||
) |
logs to everything using a C type string
int spdLogger::logToScr | ( | const char * | format, | |
... | ||||
) |
Logs to screen only, not to file nor to DIM.
int spdLogger::logToDim | ( | const char * | format, | |
... | ||||
) |
Logs to DIM and screen, not to file.
int spdLogger::logToFile | ( | const char * | format, | |
... | ||||
) |
logs to file and to screen and not to DIM
void spdLogger::deleteLogFile | ( | ) |
deletes the logfile
void spdLogger::setDimServiceName | ( | const char * | serviceName | ) |
set the DIM service log name
void spdLogger::restartLogFile | ( | ) |
renames the old log file and restarts the a clean file
the old log file is remaned to: <old filename>="">.<counter>.<day>_<month>_<year>.log
std::string spdLogger::logFile [private] |
String containing the file name.
DimService* spdLogger::logService [private] |
dim service logging channel
char spdLogger::logMsg[2000] [private] |
the log message
std::ofstream spdLogger::outfile [private] |
the handle for the output file