6 #include "opthelpers.h"
15 extern LogLevel gLogLevel
;
17 extern FILE *gLogFile
;
20 #if !defined(_WIN32) && !defined(__ANDROID__)
21 #define TRACE(...) do { \
22 if UNLIKELY(gLogLevel >= LogLevel::Trace) \
23 fprintf(gLogFile, "[ALSOFT] (II) " __VA_ARGS__); \
26 #define WARN(...) do { \
27 if UNLIKELY(gLogLevel >= LogLevel::Warning) \
28 fprintf(gLogFile, "[ALSOFT] (WW) " __VA_ARGS__); \
31 #define ERR(...) do { \
32 if UNLIKELY(gLogLevel >= LogLevel::Error) \
33 fprintf(gLogFile, "[ALSOFT] (EE) " __VA_ARGS__); \
38 #ifdef __USE_MINGW_ANSI_STDIO
39 [[gnu::format(gnu_printf
,3,4)]]
41 [[gnu::format(printf
,3,4)]]
43 void al_print(LogLevel level
, FILE *logfile
, const char *fmt
, ...);
45 #define TRACE(...) al_print(LogLevel::Trace, gLogFile, "[ALSOFT] (II) " __VA_ARGS__)
47 #define WARN(...) al_print(LogLevel::Warning, gLogFile, "[ALSOFT] (WW) " __VA_ARGS__)
49 #define ERR(...) al_print(LogLevel::Error, gLogFile, "[ALSOFT] (EE) " __VA_ARGS__)
52 #endif /* CORE_LOGGING_H */