gcontini
2020-11-14 f4e683fc6bd6ac76f9979f49d737588b6ddf16b0
src/library/base/logger.h
@@ -1,15 +1,17 @@
#ifndef logger_INCLUDED
#define logger_INCLUDED
#ifndef LOG_ENABLED
#include <errno.h>
#ifdef __cplusplus
extern "C" {
#endif
//#define LOG_DISABLED 1
#ifndef LOG_DISABLED
#include <errno.h>
#include <string.h>
#define clean_errno() (errno == 0 ? "None" : strerror(errno))
#ifdef _DEBUG
#ifndef NDEBUG
#define LOG_DEBUG(M, ...) _log("[DEBUG] (%s:%d) " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
#else
#define LOG_DEBUG(M,...)
@@ -25,7 +27,7 @@
#define LOG_ERROR(M, ...)
#endif
void _log(char* format, ...);
void _log(const char* format, ...);
void _shutdown_log();
#ifdef __cplusplus