aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cubeb_log.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cubeb_log.h')
-rw-r--r--src/cubeb_log.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/cubeb_log.h b/src/cubeb_log.h
index 4380da4..041ec75 100644
--- a/src/cubeb_log.h
+++ b/src/cubeb_log.h
@@ -52,11 +52,16 @@ cubeb_async_log_reset_threads(void);
} \
} while (0)
-/* Asynchronous verbose logging, to log in real-time callbacks. */
-/* Should not be used on android due to the use of global/static variables. */
-#define ALOGV(fmt, ...) \
+#define ALOG_INTERNAL(level, fmt, ...) \
do { \
- cubeb_async_log(fmt, ##__VA_ARGS__); \
+ if (level <= g_cubeb_log_level) { \
+ cubeb_async_log(fmt, ##__VA_ARGS__); \
+ } \
} while (0)
+/* Asynchronous logging macros to log in real-time callbacks. */
+/* Should not be used on android due to the use of global/static variables. */
+#define ALOGV(msg, ...) ALOG_INTERNAL(CUBEB_LOG_VERBOSE, msg, ##__VA_ARGS__)
+#define ALOG(msg, ...) ALOG_INTERNAL(CUBEB_LOG_NORMAL, msg, ##__VA_ARGS__)
+
#endif // CUBEB_LOG