From 5708e64d113aa77234e97c75e5a00e9ba1c78a9d Mon Sep 17 00:00:00 2001 From: gxalpha Date: Mon, 12 Apr 2021 18:23:01 +0200 Subject: [PATCH] mac-virtualcam: Hide logging behind debug flag Hides the DLog and DLogFunc macros behind the -DDEBUG flag, causing the logs to only appear in testing environments. On production build, calls to these macros will result in nothing happening. --- plugins/mac-virtualcam/src/dal-plugin/Logging.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/mac-virtualcam/src/dal-plugin/Logging.h b/plugins/mac-virtualcam/src/dal-plugin/Logging.h index 0844f321d..daa2c22c9 100644 --- a/plugins/mac-virtualcam/src/dal-plugin/Logging.h +++ b/plugins/mac-virtualcam/src/dal-plugin/Logging.h @@ -22,9 +22,15 @@ #include "Defines.h" +#ifdef DEBUG #define DLog(fmt, ...) NSLog((PLUGIN_NAME @"(DAL): " fmt), ##__VA_ARGS__) #define DLogFunc(fmt, ...) \ NSLog((PLUGIN_NAME @"(DAL): %s " fmt), __FUNCTION__, ##__VA_ARGS__) +#else +#define DLog(fmt, ...) (void)(fmt, ##__VA_ARGS__) +#define DLogFunc(fmt, ...) (void)(fmt, __FUNCTION__, ##__VA_ARGS__) +#endif + #define VLog(fmt, ...) #define VLogFunc(fmt, ...) #define ELog(fmt, ...) DLog(fmt, ##__VA_ARGS__)