log: only print error level to syslog/stderr

We only want to print the error level, and not all the levels below
error to stderr/syslog.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
This commit is contained in:
Gabriel Goller 2024-10-18 13:11:46 +02:00 committed by Thomas Lamprecht
parent 21c314b56e
commit 1b70270b2d

View File

@ -57,7 +57,7 @@ pub fn init_logger(
.with(
journald_or_stderr_layer()
.with_filter(filter_fn(|metadata| {
!LogContext::exists() || *metadata.level() >= Level::ERROR
!LogContext::exists() || *metadata.level() == Level::ERROR
}))
.with_filter(log_level),
)