carl  24.04
Computer ARithmetic Library
carl::logging::Formatter Class Reference

Formats a log messages. More...

#include <Formatter.h>

Public Member Functions

virtual ~Formatter () noexcept=default
 
virtual void configure (const Filter &f) noexcept
 Extracts the maximum width of a channel to optimize the formatting. More...
 
virtual void prefix (std::ostream &os, const std::string &channel, LogLevel level, const RecordInfo &info)
 Prints the prefix of a log message, i.e. More...
 
virtual void suffix (std::ostream &os)
 Prints the suffix of a log message, i.e. More...
 

Data Fields

bool printInformation = true
 Print information like log level, file etc. More...
 

Private Attributes

std::size_t channelwidth = 10
 Width of the longest channel. More...
 

Detailed Description

Formats a log messages.

Definition at line 17 of file Formatter.h.

Constructor & Destructor Documentation

◆ ~Formatter()

virtual carl::logging::Formatter::~Formatter ( )
virtualdefaultnoexcept

Member Function Documentation

◆ configure()

virtual void carl::logging::Formatter::configure ( const Filter f)
inlinevirtualnoexcept

Extracts the maximum width of a channel to optimize the formatting.

Parameters
fFilter.

Definition at line 30 of file Formatter.h.

◆ prefix()

virtual void carl::logging::Formatter::prefix ( std::ostream &  os,
const std::string &  channel,
LogLevel  level,
const RecordInfo info 
)
inlinevirtual

Prints the prefix of a log message, i.e.

everything that goes before the message given by the user, to the output stream.

Parameters
osOutput stream.
channelChannel name.
levelLogLevel.
infoAuxiliary information.

Definition at line 42 of file Formatter.h.

Here is the call graph for this function:

◆ suffix()

virtual void carl::logging::Formatter::suffix ( std::ostream &  os)
inlinevirtual

Prints the suffix of a log message, i.e.

everything that goes after the message given by the user, to the output stream. Usually, this is only a newline.

Parameters
osOutput stream.

Definition at line 67 of file Formatter.h.

Field Documentation

◆ channelwidth

std::size_t carl::logging::Formatter::channelwidth = 10
private

Width of the longest channel.

Definition at line 19 of file Formatter.h.

◆ printInformation

bool carl::logging::Formatter::printInformation = true

Print information like log level, file etc.

Definition at line 22 of file Formatter.h.


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