ECF 1.5
|
Logging class - handles screen output and file logging. More...
#include <Logger.h>
Classes | |
struct | Log |
Public Member Functions | |
void | log (int logLevel, std::string message) |
void | saveTo (std::string fileName) |
void | saveTo (bool check=false) |
void | saveToX (std::string fileName) |
void | saveToX () |
void | flushLog () |
deletes current logs More... | |
void | setLogFrequency (uint freq) |
void | registerParameters (StateP state) |
bool | initialize (StateP state) |
bool | operate (StateP) |
void | closeLog () |
uint | getLogLevel () |
Protected Attributes | |
std::vector< Log > | logs_ |
uint | currentLevel_ |
uint | logFrequency_ |
std::string | logFileName_ |
bool | bFileDefined_ |
std::ofstream | logFile_ |
StateP | state_ |
Logging class - handles screen output and file logging.
Current log levels (1-5): 1=only basic, essential information, 3=medium logging level (default), 5=logs everything
Logger::Logger | ( | ) |
Definition at line 5 of file Logger.cpp.
Logger::~Logger | ( | ) |
Definition at line 13 of file Logger.cpp.
void Logger::flushLog | ( | ) |
deletes current logs
Definition at line 165 of file Logger.cpp.
bool Logger::initialize | ( | StateP | state | ) |
Initialize Logger, read current logLevel from the Registry (configuration file)
Definition at line 33 of file Logger.cpp.
void Logger::log | ( | int | logLevel, |
std::string | message | ||
) |
Puts a string message into existing log and marks it with appropriate logLevel.
Definition at line 63 of file Logger.cpp.
bool Logger::operate | ( | StateP | state | ) |
Definition at line 171 of file Logger.cpp.
void Logger::registerParameters | ( | StateP | state | ) |
Definition at line 19 of file Logger.cpp.
void Logger::saveTo | ( | bool | check = false | ) |
Saves current session log into a configured logfile. New log is appended to the end of the file.
Definition at line 96 of file Logger.cpp.
void Logger::saveTo | ( | std::string | fileName | ) |
Saves current session log into a file named fileName. If file with the same name already exists, log is appended to the end of the file.
Definition at line 84 of file Logger.cpp.
void Logger::saveToX | ( | ) |
Definition at line 151 of file Logger.cpp.
void Logger::saveToX | ( | std::string | fileName | ) |
Definition at line 136 of file Logger.cpp.
void Logger::setLogFrequency | ( | uint | freq | ) |
Sets the log output frequency (in generations). If not set, the default is 1 (output each generation).
Definition at line 178 of file Logger.cpp.