[Bf-blender-cvs] [167f5a61e55] master: C Logging: add macro to check if logging is enabled

Campbell Barton noreply at git.blender.org
Wed Jul 10 11:41:23 CEST 2019


Commit: 167f5a61e553ab48048870943224228d8fb9bc3a
Author: Campbell Barton
Date:   Wed Jul 10 19:36:54 2019 +1000
Branches: master
https://developer.blender.org/rB167f5a61e553ab48048870943224228d8fb9bc3a

C Logging: add macro to check if logging is enabled

===================================================================

M	intern/clog/CLG_log.h

===================================================================

diff --git a/intern/clog/CLG_log.h b/intern/clog/CLG_log.h
index 1d78c401924..7418623755c 100644
--- a/intern/clog/CLG_log.h
+++ b/intern/clog/CLG_log.h
@@ -158,6 +158,10 @@ void CLG_logref_init(CLG_LogRef *clg_ref);
 #define CLOG_ENSURE(clg_ref) \
   ((clg_ref)->type ? (clg_ref)->type : (CLG_logref_init(clg_ref), (clg_ref)->type))
 
+#define CLOG_CHECK(clg_ref, verbose_level, ...) \
+  ((void)CLOG_ENSURE(clg_ref), \
+   ((clg_ref)->type->flag & CLG_FLAG_USE) && ((clg_ref)->type->level >= verbose_level))
+
 #define CLOG_AT_SEVERITY(clg_ref, severity, verbose_level, ...) \
   { \
     CLG_LogType *_lg_ty = CLOG_ENSURE(clg_ref); \



More information about the Bf-blender-cvs mailing list