6 #include "opthelpers.h"
15 extern LogLevel gLogLevel
;
17 extern FILE *gLogFile
;
19 #ifdef __USE_MINGW_ANSI_STDIO
20 [[gnu::format(gnu_printf
,3,4)]]
22 [[gnu::format(printf
,3,4)]]
24 void al_print(LogLevel level
, FILE *logfile
, const char *fmt
, ...);
26 #if (!defined(_WIN32) || defined(NDEBUG)) && !defined(__ANDROID__)
27 #define TRACE(...) do { \
28 if(gLogLevel >= LogLevel::Trace) UNLIKELY \
29 al_print(LogLevel::Trace, gLogFile, __VA_ARGS__); \
32 #define WARN(...) do { \
33 if(gLogLevel >= LogLevel::Warning) UNLIKELY \
34 al_print(LogLevel::Warning, gLogFile, __VA_ARGS__); \
37 #define ERR(...) do { \
38 if(gLogLevel >= LogLevel::Error) UNLIKELY \
39 al_print(LogLevel::Error, gLogFile, __VA_ARGS__); \
44 #define TRACE(...) al_print(LogLevel::Trace, gLogFile, __VA_ARGS__)
46 #define WARN(...) al_print(LogLevel::Warning, gLogFile, __VA_ARGS__)
48 #define ERR(...) al_print(LogLevel::Error, gLogFile, __VA_ARGS__)
51 #endif /* CORE_LOGGING_H */