All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Enumerations | Functions
Log.h File Reference
#include <iostream>
#include <mutex>
#include "StringBuilder.h"

Go to the source code of this file.

Classes

struct  Aux::Log::Location
 

Namespaces

 Aux
 
 Aux::Log
 
 Aux::Log::Settings
 
 Aux::Log::Impl
 

Macros

#define LOG_LEVEL_FATAL   0
 
#define LOG_LEVEL_ERROR   1
 
#define LOG_LEVEL_WARN   2
 
#define LOG_LEVEL_INFO   3
 
#define LOG_LEVEL_DEBUG   4
 
#define LOG_LEVEL_TRACE   5
 
#define LOG_LEVEL   LOG_LEVEL_TRACE
 
#define FATAL(...)
 
#define FATALF(...)
 
#define ERROR(...)
 
#define ERRORF(...)
 
#define WARN(...)
 
#define WARNF(...)
 
#define INFO(...)
 
#define INFOF(...)
 
#define DEBUG(...)
 
#define DEBUGF(...)
 
#define TRACE(...)
 
#define TRACEF(...)
 
#define TRACEPOINT
 

Enumerations

enum  Aux::Log::LogLevel {
  Aux::Log::LogLevel::trace, Aux::Log::LogLevel::debug, Aux::Log::LogLevel::info, Aux::Log::LogLevel::warn,
  Aux::Log::LogLevel::error, Aux::Log::LogLevel::fatal
}
 

Functions

void Aux::Log::setLogLevel (std::string logLevel)
 Accept loglevel as string and set. More...
 
std::string Aux::Log::getLogLevel ()
 
LogLevel Aux::Log::Settings::getLogLevel ()
 
void Aux::Log::Settings::setLogLevel (LogLevel p)
 
void Aux::Log::Settings::setPrintTime (bool b)
 
bool Aux::Log::Settings::getPrintTime ()
 
void Aux::Log::Settings::setPrintLocation (bool b)
 
bool Aux::Log::Settings::getPrintLocation ()
 
void Aux::Log::Settings::setLogfile (const std::string &filename)
 
void Aux::Log::Impl::log (const Location &loc, LogLevel p, const std::string msg)
 
template<typename... T>
void Aux::Log::log (const Location &loc, LogLevel p, const T &...args)
 
template<typename... T>
void Aux::Log::logF (const Location &loc, LogLevel p, const std::string &format, const T &...args)
 

Macro Definition Documentation

#define DEBUG (   ...)
Value:
::Aux::Log::log({__FILE__, __PRETTY_FUNCTION__, __LINE__},\
::Aux::Log::LogLevel::debug, __VA_ARGS__)
void log(const Location &loc, LogLevel p, const T &...args)
Definition: Log.h:153
#define DEBUGF (   ...)
Value:
::Aux::Log::logF({__FILE__, __PRETTY_FUNCTION__, __LINE__},\
::Aux::Log::LogLevel::debug, __VA_ARGS__)
void logF(const Location &loc, LogLevel p, const std::string &format, const T &...args)
Definition: Log.h:162
#define ERROR (   ...)
Value:
::Aux::Log::log({__FILE__, __PRETTY_FUNCTION__, __LINE__},\
void log(const Location &loc, LogLevel p, const T &...args)
Definition: Log.h:153
#define ERRORF (   ...)
Value:
::Aux::Log::logF({__FILE__, __PRETTY_FUNCTION__, __LINE__},\
void logF(const Location &loc, LogLevel p, const std::string &format, const T &...args)
Definition: Log.h:162
#define FATAL (   ...)
Value:
::Aux::Log::log({__FILE__, __PRETTY_FUNCTION__, __LINE__},\
::Aux::Log::LogLevel::fatal, __VA_ARGS__)
void log(const Location &loc, LogLevel p, const T &...args)
Definition: Log.h:153
#define FATALF (   ...)
Value:
::Aux::Log::logF({__FILE__, __PRETTY_FUNCTION__, __LINE__},\
::Aux::Log::LogLevel::fatal, __VA_ARGS__)
void logF(const Location &loc, LogLevel p, const std::string &format, const T &...args)
Definition: Log.h:162
#define INFO (   ...)
Value:
::Aux::Log::log({__FILE__, __PRETTY_FUNCTION__, __LINE__},\
void log(const Location &loc, LogLevel p, const T &...args)
Definition: Log.h:153
#define INFOF (   ...)
Value:
::Aux::Log::logF({__FILE__, __PRETTY_FUNCTION__, __LINE__},\
void logF(const Location &loc, LogLevel p, const std::string &format, const T &...args)
Definition: Log.h:162
#define LOG_LEVEL   LOG_LEVEL_TRACE
#define LOG_LEVEL_DEBUG   4
#define LOG_LEVEL_ERROR   1
#define LOG_LEVEL_FATAL   0
#define LOG_LEVEL_INFO   3
#define LOG_LEVEL_TRACE   5
#define LOG_LEVEL_WARN   2
#define TRACE (   ...)
Value:
::Aux::Log::log({__FILE__, __PRETTY_FUNCTION__, __LINE__},\
::Aux::Log::LogLevel::trace, __VA_ARGS__)
void log(const Location &loc, LogLevel p, const T &...args)
Definition: Log.h:153
#define TRACEF (   ...)
Value:
::Aux::Log::logF({__FILE__, __PRETTY_FUNCTION__, __LINE__},\
::Aux::Log::LogLevel::trace, __VA_ARGS__)
void logF(const Location &loc, LogLevel p, const std::string &format, const T &...args)
Definition: Log.h:162
#define TRACEPOINT
Value:
::Aux::Log::log({__FILE__, __PRETTY_FUNCTION__, __LINE__},\
::Aux::Log::LogLevel::trace, "tracepoint")
void log(const Location &loc, LogLevel p, const T &...args)
Definition: Log.h:153
#define WARN (   ...)
Value:
::Aux::Log::log({__FILE__, __PRETTY_FUNCTION__, __LINE__},\
::Aux::Log::LogLevel::warn, __VA_ARGS__)
void log(const Location &loc, LogLevel p, const T &...args)
Definition: Log.h:153
#define WARNF (   ...)
Value:
::Aux::Log::logF({__FILE__, __PRETTY_FUNCTION__, __LINE__},\
::Aux::Log::LogLevel::warn, __VA_ARGS__)
void logF(const Location &loc, LogLevel p, const std::string &format, const T &...args)
Definition: Log.h:162