log: fix syslog not respecting the configured log level

This commit is contained in:
Daniel Eklöf 2024-04-05 16:11:37 +02:00
parent da19c09122
commit 28a18ad91e
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 5 additions and 1 deletions

5
log.c
View file

@ -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;