public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH] log: only print error level to syslog/stderr
Date: Fri, 18 Oct 2024 13:11:46 +0200	[thread overview]
Message-ID: <20241018111146.302255-1-g.goller@proxmox.com> (raw)

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


             reply	other threads:[~2024-10-18 11:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18 11:11 Gabriel Goller [this message]
2024-10-18 17:03 ` [pbs-devel] applied: " Thomas Lamprecht
2024-10-21  7:48   ` Gabriel Goller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241018111146.302255-1-g.goller@proxmox.com \
    --to=g.goller@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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