public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH] log: only print error level to syslog/stderr
@ 2024-10-18 11:11 Gabriel Goller
  2024-10-18 17:03 ` [pbs-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 3+ messages in thread
From: Gabriel Goller @ 2024-10-18 11:11 UTC (permalink / raw)
  To: pbs-devel

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

Note: the sign was reversed "<=" would have been correct, because we
want to print everything that's *less* verbose than Level::ERROR, but
there is nothing lower than ERROR, so == is better.

 proxmox-log/src/lib.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxmox-log/src/lib.rs b/proxmox-log/src/lib.rs
index 332f66221477..8c74e42b618d 100644
--- a/proxmox-log/src/lib.rs
+++ b/proxmox-log/src/lib.rs
@@ -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),
         )
-- 
2.39.5



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-21  7:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-18 11:11 [pbs-devel] [PATCH] log: only print error level to syslog/stderr Gabriel Goller
2024-10-18 17:03 ` [pbs-devel] applied: " Thomas Lamprecht
2024-10-21  7:48   ` Gabriel Goller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal