From 371468655c0adbedbe5148fddd2dacaae9eac6e0 Mon Sep 17 00:00:00 2001 From: Thorsten Töpper Date: Thu, 7 Aug 2025 23:33:31 +0200 Subject: options/output: add --quiet to suppress error/warning messages As the LOGERR macro is modified this option will also suppress debug messages in case the executable was built with -DDEBUGBUILD. --- include/output.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/output.h') diff --git a/include/output.h b/include/output.h index 53f0869..38546aa 100644 --- a/include/output.h +++ b/include/output.h @@ -8,10 +8,11 @@ #define OUTPUT_H #include +#include "options.h" #include "data_management.h" -#define LOGERR(...) {fprintf(stderr, "[%s:%d] %s: ", __FILE__, __LINE__, __func__); fprintf(stderr, __VA_ARGS__);} +#define LOGERR(...) {if (!option_quiet){ fprintf(stderr, "[%s:%d] %s: ", __FILE__, __LINE__, __func__); fprintf(stderr, __VA_ARGS__); }} #ifdef DEBUGBUILD #define DBGTRC(...) LOGERR(__VA_ARGS__) -- cgit v1.2.3-70-g09d2