From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 2469D1FF09B for ; Mon, 12 Oct 2026 15:22:57 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id C1169217D6; Mon, 12 Oct 2026 15:22:30 +0200 (CEST) Date: Mon, 12 Oct 2026 15:20:00 +0200 From: Gabriel Goller To: Thomas Ellmenreich Subject: Re: [PATCH proxmox 1/6] log: replace per layer filtering by one global filter Message-ID: References: <20261007074527.102419-1-t.ellmenreich@proxmox.com> <20261007074527.102419-2-t.ellmenreich@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20261007074527.102419-2-t.ellmenreich@proxmox.com> User-Agent: NeoMutt/20260504 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1791811201248 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.307 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: C7MWI2LVCFR5JORGEWJFHKVDQTQLCJ3G X-Message-ID-Hash: C7MWI2LVCFR5JORGEWJFHKVDQTQLCJ3G X-MailFrom: g.goller@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: pdm-devel@lists.proxmox.com 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: > [snip] > @@ -153,10 +135,13 @@ impl Logger { > /// > /// Also configures the `LogTracer` which will convert all `log` events to tracing events. > pub fn init(self) -> Result<(), anyhow::Error> { > - let registry = tracing_subscriber::registry().with(self.layer); > + let registry = tracing_subscriber::registry() > + .with(self.layer) > + .with(self.global_log_level); > + > tracing::subscriber::set_global_default(registry)?; > > - LogTracer::init_with_filter(self.global_log_level.as_log())?; > + LogTracer::init()?; Hmm any reason why this was changed? I'm asking because this means all the log invocations (there aren't many though) will build a whole tracing record before being filtered by the level filter. When passing a global log level to the LogTracer, all the levels below will be optimized away. I'm a bit afraid that there is a crate that has a log::debug! statement in the hot-path in a loop somewhere -- that would mean we create a whole tracing record and discard it on every debug! :) Note sure if this is a big issue though -- we have very few log invocations anyway and other crates shouldn't be such a big issue. > Ok(()) > } > } > --