Template Numerical Library version\ main:94209208
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
TNL::Logger Class Reference

Creates calculations log in the form of a table. More...

#include <TNL/Logger.h>

Collaboration diagram for TNL::Logger:
Collaboration graph
[legend]

Public Member Functions

 Logger (int width, std::ostream &stream)
 Basic constructor.
 
void writeCurrentTime (const char *label)
 Inserts a line with current time into the log.
 
void writeHeader (const std::string &title)
 Creates header in given log.
 
template<typename ParameterType >
void writeParameter (const std::string &label, const ParameterType &value, int parameterLevel=0)
 Inserts parameter information into the log.
 
template<typename ParameterType >
void writeParameter (const std::string &label, const std::string &parameterName, const Config::ParameterContainer &parameters, int parameterLevel=0)
 Inserts parameter information into the log.
 
template<typename T >
void writeParameter (const std::string &label, const T &value, int parameterLevel)
 
void writeSeparator ()
 Creates separator used as a log structure.
 
bool writeSystemInformation (bool printGPUInfo=false)
 Inserts information about various system parameters into the log.
 

Protected Attributes

std::ostreamstream
 Output stream where the log will be printed out.
 
int width
 Integer defining the width of the log.
 

Detailed Description

Creates calculations log in the form of a table.

Constructor & Destructor Documentation

◆ Logger()

TNL::Logger::Logger ( int width,
std::ostream & stream )
inline

Basic constructor.

Parameters
widthInteger that defines the width of the log.
streamDefines output stream where the log will be printed out.

Member Function Documentation

◆ writeCurrentTime()

void TNL::Logger::writeCurrentTime ( const char * label)
inline

Inserts a line with current time into the log.

Parameters
labelLabel to be printed to the log together with the current time.

◆ writeHeader()

void TNL::Logger::writeHeader ( const std::string & title)
inline

Creates header in given log.

The header usually contains title of the program.

Parameters
titleA string containing the header title.

◆ writeParameter() [1/2]

template<typename ParameterType >
void TNL::Logger::writeParameter ( const std::string & label,
const ParameterType & value,
int parameterLevel = 0 )

Inserts parameter information into the log.

Template Parameters
ParameterTypeType of the parameter.
Parameters
labelDescription/label of the line.
valueParameter value.
parameterLevelInteger defining the indent used in the log.

◆ writeParameter() [2/2]

template<typename T >
void TNL::Logger::writeParameter ( const std::string & label,
const std::string & parameterName,
const Config::ParameterContainer & parameters,
int parameterLevel = 0 )

Inserts parameter information into the log.

Template Parameters
ParameterTypeType of the parameter.
Parameters
labelDescription/label of the line.
parameterNameName of the parameter.
parametersA container with configuration parameters.
parameterLevelInteger defining the indent used in the log.

◆ writeSystemInformation()

bool TNL::Logger::writeSystemInformation ( bool printGPUInfo = false)
inline

Inserts information about various system parameters into the log.

Parameters
printGPUInfoWhen true, prints information about available GPUs.

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