Don't modify the RelWithDebInfo flags
[openal-soft.git] / core / logging.h
blob527e795403ff7869638f23bde9cd53f15207be27
1 #ifndef CORE_LOGGING_H
2 #define CORE_LOGGING_H
4 #include <cstdio>
7 enum class LogLevel {
8 Disable,
9 Error,
10 Warning,
11 Trace
13 extern LogLevel gLogLevel;
15 extern FILE *gLogFile;
18 using LogCallbackFunc = void(*)(void *userptr, char level, const char *message, int length) noexcept;
20 void al_set_log_callback(LogCallbackFunc callback, void *userptr);
23 #ifdef __MINGW32__
24 [[gnu::format(__MINGW_PRINTF_FORMAT,2,3)]]
25 #else
26 [[gnu::format(printf,2,3)]]
27 #endif
28 void al_print(LogLevel level, const char *fmt, ...) noexcept;
30 #define TRACE(...) al_print(LogLevel::Trace, __VA_ARGS__)
32 #define WARN(...) al_print(LogLevel::Warning, __VA_ARGS__)
34 #define ERR(...) al_print(LogLevel::Error, __VA_ARGS__)
36 #endif /* CORE_LOGGING_H */