aboutsummaryrefslogtreecommitdiff
path: root/include/output.h
diff options
context:
space:
mode:
authorThorsten Töpper <atsutane@freethoughts.de>2025-08-07 23:33:31 +0200
committerThorsten Töpper <atsutane@freethoughts.de>2025-08-07 23:34:37 +0200
commit371468655c0adbedbe5148fddd2dacaae9eac6e0 (patch)
treedbb63532c8be17d10eef28be2866907db352d305 /include/output.h
parentafdf29bc31744905e535c04d7f4804652e64e045 (diff)
downloaddir_monitor-371468655c0adbedbe5148fddd2dacaae9eac6e0.tar.gz
dir_monitor-371468655c0adbedbe5148fddd2dacaae9eac6e0.tar.bz2
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.
Diffstat (limited to 'include/output.h')
-rw-r--r--include/output.h3
1 files changed, 2 insertions, 1 deletions
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 <stdio.h>
+#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__)