From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/2] use PROXMOX_DEBUG env variable to control loglevel
Date: Fri, 4 Feb 2022 10:12:20 +0100 [thread overview]
Message-ID: <20220204091221.1781533-1-d.csapak@proxmox.com> (raw)
so that we can use 'log::debug' to actually log debug messages
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
without this or something similar, we cannot actually see the messages
from 'log::debug' (and we're using that sometimes)
src/bin/proxmox-backup-proxy.rs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs
index 9bacac97..73844935 100644
--- a/src/bin/proxmox-backup-proxy.rs
+++ b/src/bin/proxmox-backup-proxy.rs
@@ -188,18 +188,18 @@ async fn get_index_future(env: RestEnvironment, parts: Parts) -> Response<Body>
}
async fn run() -> Result<(), Error> {
+ // Note: To debug early connection error use
+ // PROXMOX_DEBUG=1 ./target/release/proxmox-backup-proxy
+ let debug = std::env::var("PROXMOX_DEBUG").is_ok();
+
if let Err(err) = syslog::init(
syslog::Facility::LOG_DAEMON,
- log::LevelFilter::Info,
+ if debug { log::LevelFilter::Debug } else { log::LevelFilter::Info },
Some("proxmox-backup-proxy"),
) {
bail!("unable to inititialize syslog - {}", err);
}
- // Note: To debug early connection error use
- // PROXMOX_DEBUG=1 ./target/release/proxmox-backup-proxy
- let debug = std::env::var("PROXMOX_DEBUG").is_ok();
-
let _ = public_auth_key(); // load with lazy_static
let _ = csrf_secret(); // load with lazy_static
--
2.30.2
next reply other threads:[~2022-02-04 9:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-04 9:12 Dominik Csapak [this message]
2022-02-04 9:12 ` [pbs-devel] [PATCH proxmox-backup 2/2] traffic-control: add debug log when we found a matching rule Dominik Csapak
2022-02-04 10:05 ` Thomas Lamprecht
2022-02-04 10:09 ` Dominik Csapak
2022-02-04 10:21 ` Thomas Lamprecht
2022-02-04 10:22 ` [pbs-devel] applied: [PATCH proxmox-backup 1/2] use PROXMOX_DEBUG env variable to control loglevel Thomas Lamprecht
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=20220204091221.1781533-1-d.csapak@proxmox.com \
--to=d.csapak@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