From 4f1aaccf812b5ed5f1cf12184ac970b396519f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 5 Apr 2024 16:19:24 +0200 Subject: [PATCH] log: fix syslog not respecting the configured log level --- CHANGELOG.md | 4 ++++ log.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f155d116..4ff49390 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,10 @@ ### Deprecated ### Removed ### Fixed + +* Log-level not respected by syslog. + + ### Security ### Contributors diff --git a/log.c b/log.c index c13b4179..d19adaca 100644 --- a/log.c +++ b/log.c @@ -105,6 +105,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;