From bdee493f0357eb0f3f6d4b792140de78999c828e Mon Sep 17 00:00:00 2001 From: nirenjan Date: Tue, 27 Jul 2021 17:01:41 -0700 Subject: [PATCH] Add preprocessor definition to disable traces --- pinelog.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pinelog.h b/pinelog.h index dfd2b0c..b061922 100644 --- a/pinelog.h +++ b/pinelog.h @@ -165,11 +165,16 @@ void pinelog_log_message(int level, const char *file, int line, const char *fmt, } \ } while(0) +/* PINELOG_DISABLE_TRACE allows all traces to be compiled out */ +#ifndef PINELOG_DISABLE_TRACE #define PINELOG_TRACE(fmt, ...) do { \ if (PINELOG_LVL_TRACE <= pinelog_get_level()) { \ pinelog_log_message(PINELOG_LVL_TRACE, __FILE__, __LINE__, fmt, ##__VA_ARGS__); \ } \ } while(0) +#else +#define PINELOG_TRACE(fmt, ...) do { } while(0) +#endif #ifdef __cplusplus }