diff options
author | Chris Robinson <[email protected]> | 2017-01-26 18:05:34 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-01-26 18:15:19 -0800 |
commit | 3ba03c5a29bcebb1866f36555957c3c293a99962 (patch) | |
tree | bcd8da10ec0ce4d71a8ea5dce7c5815a29a2834c /OpenAL32/Include | |
parent | f0c8b7f255b17a2fcfcf622a78794cde07f033cd (diff) |
Also log to __android_log_print on Android
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r-- | OpenAL32/Include/alMain.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 1fb1dcf5..988c7d31 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -914,6 +914,13 @@ void al_print(const char *type, const char *func, const char *fmt, ...) DECL_FOR #define AL_PRINT(T, ...) al_print((T), __FUNCTION__, __VA_ARGS__) #endif +#ifdef __ANDROID__ +#include <android/log.h> +#define LOG_ANDROID(T, MSG, ...) __android_log_print(T, "openal", "AL lib: %s: "MSG, __FUNCTION__ , ## __VA_ARGS__) +#else +#define LOG_ANDROID(T, MSG, ...) ((void)0) +#endif + enum LogLevel { NoLog, LogError, @@ -926,21 +933,25 @@ extern enum LogLevel LogLevel; #define TRACEREF(...) do { \ if(LogLevel >= LogRef) \ AL_PRINT("(--)", __VA_ARGS__); \ + LOG_ANDROID(ANDROID_LOG_VERBOSE, __VA_ARGS__); \ } while(0) #define TRACE(...) do { \ if(LogLevel >= LogTrace) \ AL_PRINT("(II)", __VA_ARGS__); \ + LOG_ANDROID(ANDROID_LOG_DEBUG, __VA_ARGS__); \ } while(0) #define WARN(...) do { \ if(LogLevel >= LogWarning) \ AL_PRINT("(WW)", __VA_ARGS__); \ + LOG_ANDROID(ANDROID_LOG_WARN, __VA_ARGS__); \ } while(0) #define ERR(...) do { \ if(LogLevel >= LogError) \ AL_PRINT("(EE)", __VA_ARGS__); \ + LOG_ANDROID(ANDROID_LOG_ERROR, __VA_ARGS__); \ } while(0) |