SPH
Public Member Functions | List of all members
ILogger Class Referenceabstract

Interface providing generic (text, human readable) output of the program. More...

#include <Logger.h>

Inheritance diagram for ILogger:
Polymorphic Noncopyable FileLogger MultiLogger NullLogger StdOutLogger StringLogger

Public Member Functions

virtual void writeString (const std::string &s)=0
 Logs a string message. More...
 
template<typename... TArgs>
void write (TArgs &&... args)
 Creates and logs a message by concatenating arguments. More...
 
void setPrecision (const Size newPrecision)
 Changes the precision of printed numbers. More...
 
void setScientific (const bool newScientific)
 Sets/unsets scientific notation. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 
- Public Member Functions inherited from Noncopyable
 Noncopyable ()=default
 
 Noncopyable (const Noncopyable &)=delete
 
 Noncopyable (Noncopyable &&)=default
 
Noncopyableoperator= (const Noncopyable &)=delete
 
Noncopyableoperator= (Noncopyable &&)=default
 

Detailed Description

Interface providing generic (text, human readable) output of the program.

It's meant for logging current time, some statistics of the simulation, encountered warnings and errors, etc. For output of particle quantities, use IOutput.

Definition at line 22 of file Logger.h.

Member Function Documentation

◆ setPrecision()

void ILogger::setPrecision ( const Size  newPrecision)
inline

Changes the precision of printed numbers.

The default value is given by global PRECISION constant.

Definition at line 47 of file Logger.h.

◆ setScientific()

void ILogger::setScientific ( const bool  newScientific)
inline

Sets/unsets scientific notation.

Definition at line 52 of file Logger.h.

◆ write()

template<typename... TArgs>
void ILogger::write ( TArgs &&...  args)
inline

Creates and logs a message by concatenating arguments.

Adds a new line to the output.

Definition at line 37 of file Logger.h.

◆ writeString()

virtual void ILogger::writeString ( const std::string &  s)
pure virtual

Logs a string message.

Todo:
different types (log, warning, error, ...) and levels of verbosity

Implemented in MultiLogger, FileLogger, StringLogger, and StdOutLogger.


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