Template Numerical Library: TNL::Logger Class Reference

Template Numerical Library version\ main:16b9213d5

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:
[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.
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::ostream & | stream
| 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

  width | Integer that defines the width of the log.
  stream | Defines output stream where the log will be printed out.

## Member Function Documentation

## ◆ writeCurrentTime()

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

Inserts a line with current time into the log.

Parameters

  label | Label to be printed to the log together with the current time.

## ◆ writeHeader()

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

Creates header in given log.

The header usually contains title of the program.

Parameters

  title | A 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

  ParameterType | Type of the parameter.

Parameters

  label | Description/label of the line.
  value | Parameter value.
  parameterLevel | Integer defining the indent used in the log.

## ◆ writeParameter() [2/2]

template<typename ParameterType>

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

  ParameterType | Type of the parameter.

Parameters

  label | Description/label of the line.
  parameterName | Name of the parameter.
  parameters | A container with configuration parameters.
  parameterLevel | Integer defining the indent used in the log.

## ◆ writeSystemInformation()

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

Inserts information about various system parameters into the log.

Parameters

  printGPUInfo | When true, prints information about available GPUs.

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

- src/TNL/Logger.h