6 #include "opthelpers.h"
10 #define DECL_FORMAT(x, y, z) __attribute__((format(x, (y), (z))))
12 #define DECL_FORMAT(x, y, z)
16 extern FILE *gLogFile
;
18 void al_print(FILE *logfile
, const char *fmt
, ...) DECL_FORMAT(printf
, 2,3);
20 #define AL_PRINT fprintf
22 #define AL_PRINT al_print
26 #include <android/log.h>
27 #define LOG_ANDROID(T, ...) __android_log_print(T, "openal", "AL lib: " __VA_ARGS__)
29 #define LOG_ANDROID(T, ...) ((void)0)
39 extern LogLevel gLogLevel
;
41 #define TRACE(...) do { \
42 if UNLIKELY(gLogLevel >= LogTrace) \
43 AL_PRINT(gLogFile, "AL lib: (II) " __VA_ARGS__); \
44 LOG_ANDROID(ANDROID_LOG_DEBUG, __VA_ARGS__); \
47 #define WARN(...) do { \
48 if UNLIKELY(gLogLevel >= LogWarning) \
49 AL_PRINT(gLogFile, "AL lib: (WW) " __VA_ARGS__); \
50 LOG_ANDROID(ANDROID_LOG_WARN, __VA_ARGS__); \
53 #define ERR(...) do { \
54 if UNLIKELY(gLogLevel >= LogError) \
55 AL_PRINT(gLogFile, "AL lib: (EE) " __VA_ARGS__); \
56 LOG_ANDROID(ANDROID_LOG_ERROR, __VA_ARGS__); \
59 #endif /* LOGGING_H */