26 #include "../config.h"
30 #define ERROR_BUFFER_SIZE 1024
33 #if LOG_LEVEL < 1 || LOG_LEVEL > 5
34 # error Log level has to be in [1, 5], see config.h
38 # define LogV(...) {char b[ERROR_BUFFER_SIZE]; snprintf(b, ERROR_BUFFER_SIZE, __VA_ARGS__); Log::verbose(b, __LINE__, __FILE__, __func__);}
44 # define LogD(...) {char b[ERROR_BUFFER_SIZE]; snprintf(b, ERROR_BUFFER_SIZE, __VA_ARGS__); Log::debug(b, __LINE__, __FILE__, __func__);}
50 # define LogI(...) {char b[ERROR_BUFFER_SIZE]; snprintf(b, ERROR_BUFFER_SIZE, __VA_ARGS__); Log::information(b, __LINE__, __FILE__, __func__);}
56 # define LogW(...) {char b[ERROR_BUFFER_SIZE]; snprintf(b, ERROR_BUFFER_SIZE, __VA_ARGS__); Log::warning(b, __LINE__, __FILE__, __func__);}
62 # define LogE(...) {char b[ERROR_BUFFER_SIZE]; snprintf(b, ERROR_BUFFER_SIZE, __VA_ARGS__); Log::error(b, __LINE__, __FILE__, __func__);}
82 static void verbose(
const char *text,
int line,
const char *file,
const char *
function);
83 static void debug(
const char *text,
int line,
const char *file,
const char *
function);
84 static void information(
const char *text,
int line,
const char *file,
const char *
function);
85 static void warning(
const char *text,
int line,
const char *file,
const char *
function);
86 static void error(
const char *text,
int line,
const char *file,
const char *
function);
88 Log(
bool useLogfile =
true);
102 void writeToLogfile(
ELevel level,
const char *text,
int line,
const char *file,
const char *
function);
105 static std::shared_ptr<Log>
mLog;
107 static const char*
simplify (
const char* filename);
static void error(const char *text, int line, const char *file, const char *function)
static Log & getSingleton()
static void verbose(const char *text, int line, const char *file, const char *function)
static void information(const char *text, int line, const char *file, const char *function)
virtual void impl_error(const char *l)
virtual void impl_debug(const char *l)
static const char * simplify(const char *filename)
Log(bool useLogfile=true)
static void warning(const char *text, int line, const char *file, const char *function)
void writeToLogfile(ELevel level, const char *text, int line, const char *file, const char *function)
static Log * getSingletonPtr()
virtual void impl_verbose(const char *l)
static std::shared_ptr< Log > mLog
static const std::string LOG_NAME
virtual void impl_warning(const char *l)
virtual void impl_information(const char *l)
static void debug(const char *text, int line, const char *file, const char *function)