aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include/alMain.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-07-10 21:30:25 -0700
committerChris Robinson <[email protected]>2011-07-10 21:30:25 -0700
commitb64156aa2bf3821cb139b60df2450f3a93bf3f9a (patch)
treefd199273555ada0f6a189f70d097aa00b89fbfea /OpenAL32/Include/alMain.h
parent5cb4129bc7ba0e5fe3638eb043459b3329175fae (diff)
Add some macros for logging at various levels, and use them
Diffstat (limited to 'OpenAL32/Include/alMain.h')
-rw-r--r--OpenAL32/Include/alMain.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index d04fc449..95d08483 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -533,6 +533,30 @@ void al_print(const char *fname, unsigned int line, const char *fmt, ...)
PRINTF_STYLE(3,4);
#define AL_PRINT(...) al_print(__FILE__, __LINE__, __VA_ARGS__)
+enum LogLevel {
+ NoLog,
+ LogError,
+ LogWarning,
+ LogTrace
+};
+extern enum LogLevel LogLevel;
+
+#define TRACE(...) do { \
+ if(LogLevel >= LogTrace) \
+ AL_PRINT(__VA_ARGS__); \
+} while(0)
+
+#define WARN(...) do { \
+ if(LogLevel >= LogWarning) \
+ AL_PRINT(__VA_ARGS__); \
+} while(0)
+
+#define ERROR(...) do { \
+ if(LogLevel >= LogError) \
+ AL_PRINT(__VA_ARGS__); \
+} while(0)
+
+
extern ALdouble ConeScale;
extern ALdouble ZScale;