From 28a18ad91e67e67d634f82d431c6b2ceab905640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 5 Apr 2024 16:11:37 +0200 Subject: [PATCH] log: fix syslog not respecting the configured log level --- CHANGELOG.md | 1 + log.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b181fca..2d01729 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ * i3/sway: module fails when reloading config file ([#361][361]). * Worked around bug in gcc causing a compilation error ([#350][350]). * Miscalculation of list width in presence of empty particles ([#369][369]). +* Log-level not respected by syslog. [311]: https://codeberg.org/dnkl/yambar/issues/311 [302]: https://codeberg.org/dnkl/yambar/issues/302 diff --git a/log.c b/log.c index 5864853..2d454a8 100644 --- a/log.c +++ b/log.c @@ -15,7 +15,7 @@ #define UNUSED __attribute__((unused)) static bool colorize = false; -static bool do_syslog = true; +static bool do_syslog = false; static enum log_class log_level = LOG_CLASS_NONE; static const struct { @@ -102,6 +102,9 @@ _sys_log(enum log_class log_class, const char *module, if (!do_syslog) return; + if (log_class > log_level) + return; + /* Map our log level to syslog's level */ int level = log_level_map[log_class].syslog_equivalent;