From e8bb162220ac17cb9b8cc229666356e88f081887 Mon Sep 17 00:00:00 2001 From: Ben Fuhrmannek Date: Sat, 7 Aug 2021 15:55:48 +0200 Subject: prevent STDERR debug output based on SP_NODEBUG environment variable --- src/sp_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sp_utils.h') diff --git a/src/sp_utils.h b/src/sp_utils.h index ec79e8b..c0ddbe4 100644 --- a/src/sp_utils.h +++ b/src/sp_utils.h @@ -57,7 +57,7 @@ #ifdef SP_DEBUG_STDERR extern int sp_debug_stderr; #define sp_log_debug(fmt, ...) \ - dprintf(sp_debug_stderr, "[snuffleupagus][DEBUG] %s(): " fmt "\n", __FUNCTION__, ##__VA_ARGS__); + if (sp_debug_stderr > 0) dprintf(sp_debug_stderr, "[snuffleupagus][DEBUG] %s(): " fmt "\n", __FUNCTION__, ##__VA_ARGS__); #else #define sp_log_debug(fmt, ...) \ sp_log_msgf("DEBUG", SP_LOG_DEBUG, SP_TYPE_LOG, "%s(): " fmt, __FUNCTION__, ##__VA_ARGS__) -- cgit v1.3