From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id C31111FF0AF for ; Fri, 23 Oct 2026 13:31:32 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B30022167C; Fri, 23 Oct 2026 13:31:27 +0200 (CEST) From: Thomas Ellmenreich To: pdm-devel@lists.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 Message-ID: <20261023113120.332453-6-t.ellmenreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261023113120.332453-1-t.ellmenreich@proxmox.com> References: <20261023113120.332453-1-t.ellmenreich@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792755082620 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.394 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: IYUMA23B2LEX2G4VXBXOUCMUYVSPDODX X-Message-ID-Hash: IYUMA23B2LEX2G4VXBXOUCMUYVSPDODX X-MailFrom: t.ellmenreich@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Thomas Ellmenreich X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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