PCB Environment 2
Loading...
Searching...
No Matches
Log.hpp File Reference
#include <iomanip>
#include <chrono>
#include <fstream>
#include <sstream>
#include <set>
#include <string>
#include <thread>

Go to the source code of this file.

Data Structures

class  LogFile
class  Logger

Macros

#define GYM_PCB_MAX_LOG_LEVEL   3
#define GYM_PCB_LOG_SHOW_THREAD   0
#define GYM_PCB_LOG_FORMAT_TIME   1
#define _PCB_GYM_LOG_IF(v, func, args...)
#define ERROR(args...)
#define WARN(args...)
#define INFO(args...)
#define NOTICE(args...)
#define DEBUG(args...)
#define TRACE(args...)
#define RETURN_ERROR(rv, args...)

Enumerations

enum class  LogLevel {
  ERROR = 0 , WARNING = 1 , NOTICE = 2 , INFO = 3 ,
  DEBUG = 4 , TRACE = 5 , COUNT = 6
}

Macro Definition Documentation

◆ _PCB_GYM_LOG_IF

#define _PCB_GYM_LOG_IF ( v,
func,
args... )
Value:
if (int(v) <= GYM_PCB_MAX_LOG_LEVEL && Logger::get().visible(v)) { std::stringstream ___ss; ___ss << args; Logger::get().func(___ss.str()); }
#define GYM_PCB_MAX_LOG_LEVEL
Definition Log.hpp:25
static Logger & get()
Definition Log.hpp:76

◆ DEBUG

#define DEBUG ( args...)
Value:
do { _PCB_GYM_LOG_IF(LogLevel::DEBUG, Debug, args) } while (0)
#define _PCB_GYM_LOG_IF(v, func, args...)
Definition Log.hpp:34
@ DEBUG
Definition Log.hpp:19

◆ ERROR

#define ERROR ( args...)
Value:
do { _PCB_GYM_LOG_IF(LogLevel::ERROR, Error, args) } while (0)
@ ERROR
Definition Log.hpp:15

◆ GYM_PCB_LOG_FORMAT_TIME

#define GYM_PCB_LOG_FORMAT_TIME   1

◆ GYM_PCB_LOG_SHOW_THREAD

#define GYM_PCB_LOG_SHOW_THREAD   0

◆ GYM_PCB_MAX_LOG_LEVEL

#define GYM_PCB_MAX_LOG_LEVEL   3

◆ INFO

#define INFO ( args...)
Value:
do { _PCB_GYM_LOG_IF(LogLevel::INFO, Info, args) } while (0)
@ INFO
Definition Log.hpp:18

◆ NOTICE

#define NOTICE ( args...)
Value:
do { _PCB_GYM_LOG_IF(LogLevel::NOTICE, Notice, args) } while (0)
@ NOTICE
Definition Log.hpp:17

◆ RETURN_ERROR

#define RETURN_ERROR ( rv,
args... )
Value:
do { ERROR(args); return rv; } while (0)
#define ERROR(args...)
Definition Log.hpp:36

◆ TRACE

#define TRACE ( args...)
Value:
do { _PCB_GYM_LOG_IF(LogLevel::TRACE, Trace, args) } while (0)
@ TRACE
Definition Log.hpp:20

◆ WARN

#define WARN ( args...)
Value:
do { _PCB_GYM_LOG_IF(LogLevel::WARNING, Warn, args) } while (0)
@ WARNING
Definition Log.hpp:16

Enumeration Type Documentation

◆ LogLevel

enum class LogLevel
strong
Enumerator
ERROR 
WARNING 
NOTICE 
INFO 
DEBUG 
TRACE 
COUNT