AQUAgpusph 5.0.4
Loading...
Searching...
No Matches
Aqua::InputOutput::Logger Class Reference

On screen and log file output manager. More...

#include <Logger.hpp>

Inheritance diagram for Aqua::InputOutput::Logger:
Collaboration diagram for Aqua::InputOutput::Logger:

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 Loggersingleton ()
 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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~Logger()

Aqua::InputOutput::Logger::~Logger ( )

Destructor.

Here is the call graph for this function:

◆ Logger()

Aqua::InputOutput::Logger::Logger ( const Logger & obj)
delete
Here is the call graph for this function:

Member Function Documentation

◆ addMessage()

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.

Parameters
levelMessage classification (L_DEBUG, L_INFO, L_WARNING, L_ERROR)
logLog message.
funcFunction name to print, NULL if it should not be printed.
Note
In order to append the class and the method name before the message use addMessageF instead of this one.
Here is the call graph for this function:

◆ close()

void Aqua::InputOutput::Logger::close ( )
protected

Close the log file.

Here is the call graph for this function:

◆ open()

void Aqua::InputOutput::Logger::open ( )
protected

Create the log file.

Here is the call graph for this function:

◆ printDate()

void Aqua::InputOutput::Logger::printDate ( TLogLevel level = L_DEBUG)

Print a time stamp in the screen and the log file.

Parameters
levelMessage classification (L_DEBUG, L_INFO, L_WARNING, L_ERROR)
Here is the call graph for this function:

◆ printOpenCLError()

void Aqua::InputOutput::Logger::printOpenCLError ( cl_int error,
TLogLevel level = L_DEBUG )

Print an OpenCL error.

Parameters
errorError code returned by OpenCL.
levelMessage classification (L_DEBUG, L_INFO, L_WARNING, L_ERROR)
Here is the call graph for this function:

◆ save()

void Aqua::InputOutput::Logger::save ( float UNUSED_PARAM t)
inline

Do nothing.

Parameters
tSimulation time

◆ setLevel()

void Aqua::InputOutput::Logger::setLevel ( int level)
inline

Set the log level.

Parameters
levelThe minimum message log level to get printed

◆ singleton()

Logger * Aqua::InputOutput::Logger::singleton ( )
static

Get –creating it the first time– the logger instance.

Just one logger can simultaneously exist

Returns
The logger
Here is the call graph for this function:

◆ writeReport()

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

Parameters
msgMessage to print in the screen.
Here is the call graph for this function:

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