From: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
To: pdm-devel@lists.proxmox.com
Cc: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
Subject: [PATCH proxmox v2 5/7] rest-server: enable debug based on log level
Date: Fri, 23 Oct 2026 13:31:16 +0200 [thread overview]
Message-ID: <20261023113120.332453-6-t.ellmenreich@proxmox.com> (raw)
In-Reply-To: <20261023113120.332453-1-t.ellmenreich@proxmox.com>
To set the debug flag of the REST server, a call to AcceptBuilder::debug()
was necessary. Callers would then usually just inspect the current
log level and set the debug flag accordingly. So, instead of
defaulting to false for the debug flag, set it according to
the debug level.
This has the advantage that the REST server's debug flag can also
be set by only changing the log level of the relevant module,
like so:
proxmox_rest_server::connection=debug
Users of the REST server can still call debug and retain their previous
implementation, this only changes the default.
Signed-off-by: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
---
proxmox-rest-server/src/connection.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/proxmox-rest-server/src/connection.rs b/proxmox-rest-server/src/connection.rs
index 153a44b0..dfcec7f1 100644
--- a/proxmox-rest-server/src/connection.rs
+++ b/proxmox-rest-server/src/connection.rs
@@ -193,7 +193,7 @@ pub struct AcceptBuilder {
impl Default for AcceptBuilder {
fn default() -> Self {
Self {
- debug: false,
+ debug: proxmox_log::enabled!(proxmox_log::Level::DEBUG),
tcp_keepalive_time: 120,
max_pending_accepts: 1024,
--
2.47.3
next prev parent reply other threads:[~2026-10-23 11:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 11:31 [PATCH datacenter-manager/proxmox v2 0/7] log: allow finegrained control log levels Thomas Ellmenreich
2026-10-23 11:31 ` [PATCH proxmox v2 1/7] log: replace per layer filtering with one global filter Thomas Ellmenreich
2026-10-23 11:31 ` [PATCH proxmox v2 2/7] fix #6081: log: replace simple level filter with env filter Thomas Ellmenreich
2026-10-23 11:31 ` [PATCH proxmox v2 3/7] log: add tests to the logger Thomas Ellmenreich
2026-10-23 11:31 ` [PATCH proxmox v2 4/7] log: clean up of logger components Thomas Ellmenreich
2026-10-23 11:31 ` Thomas Ellmenreich [this message]
2026-10-23 11:31 ` [PATCH datacenter-manager v2 6/7] api: remove manual setting of REST server debug flag Thomas Ellmenreich
2026-10-23 11:31 ` [PATCH datacenter-manager v2 7/7] api: rename PROXMOX_DEBUG log variable to PDM_LOG Thomas Ellmenreich
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=20261023113120.332453-6-t.ellmenreich@proxmox.com \
--to=t.ellmenreich@proxmox.com \
--cc=pdm-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