public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 1/2] use PROXMOX_DEBUG env variable to control loglevel
@ 2022-02-04  9:12 Dominik Csapak
  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:22 ` [pbs-devel] applied: [PATCH proxmox-backup 1/2] use PROXMOX_DEBUG env variable to control loglevel Thomas Lamprecht
  0 siblings, 2 replies; 6+ messages in thread
From: Dominik Csapak @ 2022-02-04  9:12 UTC (permalink / raw)
  To: pbs-devel

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





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

end of thread, other threads:[~2022-02-04 10:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04  9:12 [pbs-devel] [PATCH proxmox-backup 1/2] use PROXMOX_DEBUG env variable to control loglevel Dominik Csapak
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

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