Version: SMASH-3.1
einhard.hpp File Reference

This is the main include file for Einhard. More...

#include <assert.h>
#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstring>
#include <sstream>
#include <bitset>
#include "stacktrace.h"
#include <cstdio>
#include <unistd.h>

Go to the source code of this file.

Classes

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

Namespaces

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

Macros

#define EINHARD_ALWAYS_INLINE_
 
#define _COLOR(name, code)
 

Typedefs

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

Enumerations

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

Functions

template<LogLevel >
const char * einhard::getLogLevelString () noexcept
 Retrieve a human readable representation of the given log level value. More...
 
const char * einhard::getLogLevelString (LogLevel level)
 Overload of the above function for situations where the LogLevel level is only determined at run time. More...
 
LogLevel einhard::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 * einhard::colorForLogLevel () noexcept
 

Variables

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

Detailed Description

This is the main include file for Einhard.

Copyright 2010 Matthias Bach marix.nosp@m.@mar.nosp@m.ix.or.nosp@m.g Copyright 2014 Matthias Kretz kretz.nosp@m.@kde.nosp@m..org

This file is part of Einhard.

Einhard is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Einhard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Einhard. If not, see http://www.gnu.org/licenses/.

Definition in file einhard.hpp.

Macro Definition Documentation

◆ EINHARD_ALWAYS_INLINE_

#define EINHARD_ALWAYS_INLINE_

Definition at line 79 of file einhard.hpp.

◆ _COLOR

#define _COLOR (   name,
  code 
)
Value:
struct name##_t_ \
{ \
static char const *ANSI() noexcept \
{ \
return "\33[" code "m"; \
} \
}; \
typedef Color<name##_t_> name

Definition at line 170 of file einhard.hpp.