C Logging: add macro to check if logging is enabled

This commit is contained in:
Campbell Barton 2019-07-10 19:36:54 +10:00
parent d4d16e7a03
commit 167f5a61e5
1 changed files with 4 additions and 0 deletions

View File

@ -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); \