Version: SMASH-1.6
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  Logger
 A Logger object can be used to output messages to stdout. More...
 
class  OutputFormatter
 A wrapper for the output stream taking care proper formatting and colorization of the output. More...
 
class  UnconditionalOutput
 

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

typedef Color< DGray_t_> einhard::DGray

Color stream modifier.

Definition at line 180 of file einhard.hpp.

typedef Color< Black_t_> einhard::Black

Color stream modifier.

Definition at line 181 of file einhard.hpp.

typedef Color< Red_t_> einhard::Red

Color stream modifier.

Definition at line 182 of file einhard.hpp.

typedef Color< DRed_t_> einhard::DRed

Color stream modifier.

Definition at line 183 of file einhard.hpp.

typedef Color< Green_t_> einhard::Green

Color stream modifier.

Definition at line 184 of file einhard.hpp.

typedef Color< DGreen_t_> einhard::DGreen

Color stream modifier.

Definition at line 185 of file einhard.hpp.

typedef Color< Yellow_t_> einhard::Yellow

Color stream modifier.

Definition at line 186 of file einhard.hpp.

typedef Color< Orange_t_> einhard::Orange

Color stream modifier.

Definition at line 187 of file einhard.hpp.

typedef Color< Blue_t_> einhard::Blue

Color stream modifier.

Definition at line 188 of file einhard.hpp.

typedef Color< DBlue_t_> einhard::DBlue

Color stream modifier.

Definition at line 189 of file einhard.hpp.

typedef Color< Magenta_t_> einhard::Magenta

Color stream modifier.

Definition at line 190 of file einhard.hpp.

typedef Color< DMagenta_t_> einhard::DMagenta

Color stream modifier.

Definition at line 191 of file einhard.hpp.

typedef Color< Cyan_t_> einhard::Cyan

Color stream modifier.

Definition at line 192 of file einhard.hpp.

typedef Color< DCyan_t_> einhard::DCyan

Color stream modifier.

Definition at line 193 of file einhard.hpp.

typedef Color< White_t_> einhard::White

Color stream modifier.

Definition at line 194 of file einhard.hpp.

typedef Color< Gray_t_> einhard::Gray

Color stream modifier.

Definition at line 195 of file einhard.hpp.

typedef Color< NoColor_t_> einhard::NoColor

Color stream modifier.

Definition at line 196 of file einhard.hpp.

Enumeration Type Documentation

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  };
The lowes severity for messages describing the program flow.
Definition: einhard.hpp:107
Warning messages.
Definition: einhard.hpp:110
If selected no messages will be output.
Definition: einhard.hpp:113
Non-fatal errors.
Definition: einhard.hpp:111
Messages of informational nature, expected processing time e.g.
Definition: einhard.hpp:109
Debug messages.
Definition: einhard.hpp:108
Messages that indicate terminal application failure.
Definition: einhard.hpp:112
Log all message.
Definition: einhard.hpp:106

Function Documentation

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.

Here is the caller graph for this function:

const char* einhard::getLogLevelString ( LogLevel  level)

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

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.

Here is the caller graph for this function:

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

Variable Documentation

char const einhard::VERSION[]

Version string of the Einhard library.