Version: SMASH-3.1
einhard Namespace Reference

This namespace contains all objects required for logging using Einhard. More...

Classes

class  Color
 A stream modifier that allows to colorize the log output. More...
 
struct  DummyOutputFormatter
 A minimal class that implements the output stream operator to do nothing. More...
 
class  UnconditionalOutput
 
class  OutputFormatter
 A wrapper for the output stream taking care proper formatting and colorization of the output. More...
 
class  Logger
 A Logger object can be used to output messages to stdout. More...
 

Typedefs

typedef Color< DGray_t_ > DGray
 Color stream modifier. More...
 
typedef Color< Black_t_ > Black
 Color stream modifier. More...
 
typedef Color< Red_t_ > Red
 Color stream modifier. More...
 
typedef Color< DRed_t_ > DRed
 Color stream modifier. More...
 
typedef Color< Green_t_ > Green
 Color stream modifier. More...
 
typedef Color< DGreen_t_ > DGreen
 Color stream modifier. More...
 
typedef Color< Yellow_t_ > Yellow
 Color stream modifier. More...
 
typedef Color< Orange_t_ > Orange
 Color stream modifier. More...
 
typedef Color< Blue_t_ > Blue
 Color stream modifier. More...
 
typedef Color< DBlue_t_ > DBlue
 Color stream modifier. More...
 
typedef Color< Magenta_t_ > Magenta
 Color stream modifier. More...
 
typedef Color< DMagenta_t_ > DMagenta
 Color stream modifier. More...
 
typedef Color< Cyan_t_ > Cyan
 Color stream modifier. More...
 
typedef Color< DCyan_t_ > DCyan
 Color stream modifier. More...
 
typedef Color< White_t_ > White
 Color stream modifier. More...
 
typedef Color< Gray_t_ > Gray
 Color stream modifier. More...
 
typedef Color< NoColor_t_ > NoColor
 Color stream modifier. More...
 

Enumerations

enum  LogLevel {
  ALL , TRACE , DEBUG , INFO ,
  WARN , ERROR , FATAL , OFF
}
 Specification of the message severity. More...
 

Functions

template<LogLevel >
const char * getLogLevelString () noexcept
 Retrieve a human readable representation of the given log level value. More...
 
const char * getLogLevelString (LogLevel level)
 Overload of the above function for situations where the LogLevel level is only determined at run time. More...
 
LogLevel getLogLevel (const std::string &level)
 Compares the string level against the strings for LogLevel and returns the one it matches. More...
 
template<LogLevel >
const char * colorForLogLevel () noexcept
 

Variables

char const VERSION []
 Version string of the Einhard library. More...
 

Detailed Description

This namespace contains all objects required for logging using Einhard.

Typedef Documentation

◆ DGray

typedef Color< DGray_t_> einhard::DGray

Color stream modifier.

Definition at line 180 of file einhard.hpp.

◆ Black

typedef Color< Black_t_> einhard::Black

Color stream modifier.

Definition at line 181 of file einhard.hpp.

◆ Red

typedef Color< Red_t_> einhard::Red

Color stream modifier.

Definition at line 182 of file einhard.hpp.

◆ DRed

typedef Color< DRed_t_> einhard::DRed

Color stream modifier.

Definition at line 183 of file einhard.hpp.

◆ Green

typedef Color< Green_t_> einhard::Green

Color stream modifier.

Definition at line 184 of file einhard.hpp.

◆ DGreen

typedef Color< DGreen_t_> einhard::DGreen

Color stream modifier.

Definition at line 185 of file einhard.hpp.

◆ Yellow

typedef Color< Yellow_t_> einhard::Yellow

Color stream modifier.

Definition at line 186 of file einhard.hpp.

◆ Orange

typedef Color< Orange_t_> einhard::Orange

Color stream modifier.

Definition at line 187 of file einhard.hpp.

◆ Blue

typedef Color< Blue_t_> einhard::Blue

Color stream modifier.

Definition at line 188 of file einhard.hpp.

◆ DBlue

typedef Color< DBlue_t_> einhard::DBlue

Color stream modifier.

Definition at line 189 of file einhard.hpp.

◆ Magenta

typedef Color< Magenta_t_> einhard::Magenta

Color stream modifier.

Definition at line 190 of file einhard.hpp.

◆ DMagenta

typedef Color< DMagenta_t_> einhard::DMagenta

Color stream modifier.

Definition at line 191 of file einhard.hpp.

◆ Cyan

typedef Color< Cyan_t_> einhard::Cyan

Color stream modifier.

Definition at line 192 of file einhard.hpp.

◆ DCyan

typedef Color< DCyan_t_> einhard::DCyan

Color stream modifier.

Definition at line 193 of file einhard.hpp.

◆ White

typedef Color< White_t_> einhard::White

Color stream modifier.

Definition at line 194 of file einhard.hpp.

◆ Gray

typedef Color< Gray_t_> einhard::Gray

Color stream modifier.

Definition at line 195 of file einhard.hpp.

◆ NoColor

typedef Color< NoColor_t_> einhard::NoColor

Color stream modifier.

Definition at line 196 of file einhard.hpp.

Enumeration Type Documentation

◆ LogLevel

Specification of the message severity.

In output each level automatically includes the higher levels.

Enumerator
ALL 

Log all message.

TRACE 

The lowes severity for messages describing the program flow.

DEBUG 

Debug messages.

INFO 

Messages of informational nature, expected processing time e.g.

WARN 

Warning messages.

ERROR 

Non-fatal errors.

FATAL 

Messages that indicate terminal application failure.

OFF 

If selected no messages will be output.

Definition at line 104 of file einhard.hpp.

105  {
106  ALL,
107  TRACE,
108  DEBUG,
109  INFO,
110  WARN,
111  ERROR,
112  FATAL,
113  OFF
114  };
@ TRACE
The lowes severity for messages describing the program flow.
Definition: einhard.hpp:107
@ OFF
If selected no messages will be output.
Definition: einhard.hpp:113
@ WARN
Warning messages.
Definition: einhard.hpp:110
@ ALL
Log all message.
Definition: einhard.hpp:106
@ ERROR
Non-fatal errors.
Definition: einhard.hpp:111
@ DEBUG
Debug messages.
Definition: einhard.hpp:108
@ FATAL
Messages that indicate terminal application failure.
Definition: einhard.hpp:112
@ INFO
Messages of informational nature, expected processing time e.g.
Definition: einhard.hpp:109

Function Documentation

◆ getLogLevelString() [1/2]

template<LogLevel >
const char* einhard::getLogLevelString ( )
noexcept

Retrieve a human readable representation of the given log level value.

The overload can optimize better because it can determine the LogLevel at compile time.

◆ getLogLevelString() [2/2]

const char* einhard::getLogLevelString ( LogLevel  level)

Overload of the above function for situations where the LogLevel level is only determined at run time.

◆ getLogLevel()

LogLevel einhard::getLogLevel ( const std::string &  level)

Compares the string level against the strings for LogLevel and returns the one it matches.

Parameters
levelA string, which is a textual representation of one of the LogLevel enumerators.
Returns
The enumerator that matches the input string.
Exceptions
std::invalid_argumentif the string does not match any enumerator.

◆ colorForLogLevel()

template<LogLevel >
const char* einhard::colorForLogLevel ( )
noexcept

Variable Documentation

◆ VERSION

char const einhard::VERSION[]
extern

Version string of the Einhard library.