浏览代码

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.
gxalpha 4 年之前
父节点
当前提交
5708e64d11
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      plugins/mac-virtualcam/src/dal-plugin/Logging.h

+ 6 - 0
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__)