diff --git a/src/core/log.cpp b/src/core/log.cpp index 56d7b44..a6692f9 100644 --- a/src/core/log.cpp +++ b/src/core/log.cpp @@ -11,6 +11,14 @@ pthread_mutex_t log_mutex = PTHREAD_MUTEX_INITIALIZER; +const int LOG_FATAL = 0; +const int LOG_ERROR = 1; +const int LOG_WARNING = 2; +const int LOG_INFO = 3; +const int LOG_VERBOSE = 4; +const int LOG_DEBUG = 5; +const int LOG_TRACE = 6; + bool line_begin = true; int current_level = 0; //int max_level = LOG_DEBUG; diff --git a/src/core/log.h b/src/core/log.h index 67e001f..da1e94e 100644 --- a/src/core/log.h +++ b/src/core/log.h @@ -2,19 +2,20 @@ // Copyright 2014 Perttu Ahola #pragma once +extern const int LOG_FATAL; +extern const int LOG_ERROR; +extern const int LOG_WARNING; +extern const int LOG_INFO; +extern const int LOG_VERBOSE; +extern const int LOG_DEBUG; +extern const int LOG_TRACE; + void log_set_max_level(int level); int log_get_max_level(); void log_set_file(const char *path); void log_close(); void log_nl(); -#define LOG_FATAL 0 -#define LOG_ERROR 1 -#define LOG_WARNING 2 -#define LOG_INFO 3 -#define LOG_VERBOSE 4 -#define LOG_DEBUG 5 -#define LOG_TRACE 6 void log_(int level, const char *sys, const char *fmt, ...) __attribute__((format(printf, 3, 4))); #define log_f(sys, fmt, ...) log_(LOG_FATAL, sys, fmt, ##__VA_ARGS__)