From 7b944ff11add23f29f93aaabe0004bd0845e157d Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 4 Feb 2022 10:12:20 +0100 Subject: [PATCH] re-use PROXMOX_DEBUG env variable to control log level filter So that we can make 'log::debug' messages actually appear in the syslog. Signed-off-by: Dominik Csapak Signed-off-by: Thomas Lamprecht --- 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 } 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