AQUAgpusph 5.0.4
|
On screen and log file output manager. More...
#include <Logger.hpp>
Public Member Functions | |
~Logger () | |
Destructor. | |
Logger (const Logger &obj)=delete | |
void | setLevel (int level) |
Set the log level. | |
void | writeReport (std::string msg) |
Write a new message in the terminal output. | |
void | addMessage (TLogLevel level, std::string log, std::string func="") |
Add a new log record message. | |
void | printDate (TLogLevel level=L_DEBUG) |
Print a time stamp in the screen and the log file. | |
void | printOpenCLError (cl_int error, TLogLevel level=L_DEBUG) |
Print an OpenCL error. | |
void | save (float UNUSED_PARAM t) |
Do nothing. | |
Public Member Functions inherited from Aqua::InputOutput::Report | |
virtual void | save (float t)=0 |
Save the data. | |
virtual void | load () |
Load the data. | |
std::string | file () |
Get the used output file path. |
Static Public Member Functions | |
static Logger * | singleton () |
Get –creating it the first time– the logger instance. |
Protected Member Functions | |
void | open () |
Create the log file. | |
void | close () |
Close the log file. | |
Protected Member Functions inherited from Aqua::InputOutput::Report | |
Report () | |
Constructor. | |
virtual | ~Report () |
Destructor. | |
void | file (std::string filename) |
Set the report file name. | |
void | file (std::string basename, unsigned int start_index) |
Look for the first non-existing file name. | |
Protected Member Functions inherited from Aqua::InputOutput::InputOutput | |
InputOutput () | |
Constructor. | |
virtual | ~InputOutput () |
Destructor. |
On screen and log file output manager.
AQUAgpusph is generating, during runtime, an HTML log file, placed in the execution folder, and named log.X.html, where X is replaced by the first unsigned integer which generates a non-existing file.
Aqua::InputOutput::Logger::~Logger | ( | ) |
Destructor.
void Aqua::InputOutput::Logger::addMessage | ( | TLogLevel | level, |
std::string | log, | ||
std::string | func = "" ) |
Add a new log record message.
The old messages may be removed from the terminal if no more space left.
level | Message classification (L_DEBUG, L_INFO, L_WARNING, L_ERROR) |
log | Log message. |
func | Function name to print, NULL if it should not be printed. |
|
protected |
Close the log file.
|
protected |
Create the log file.
Print a time stamp in the screen and the log file.
level | Message classification (L_DEBUG, L_INFO, L_WARNING, L_ERROR) |
Print an OpenCL error.
error | Error code returned by OpenCL. |
level | Message classification (L_DEBUG, L_INFO, L_WARNING, L_ERROR) |
|
inline |
Do nothing.
t | Simulation time |
|
inline |
Set the log level.
level | The minimum message log level to get printed |
|
static |
Get –creating it the first time– the logger instance.
Just one logger can simultaneously exist
void Aqua::InputOutput::Logger::writeReport | ( | std::string | msg | ) |
Write a new message in the terminal output.
This method is not redirecting the data to the log file. A line break '\n' is appended if it is not detected at the end
msg | Message to print in the screen. |