From: "Lukas Wagner" <l.wagner@proxmox.com>
To: "Thomas Ellmenreich" <t.ellmenreich@proxmox.com>,
<pdm-devel@lists.proxmox.com>
Subject: Re: [PATCH proxmox v2 3/4] log: add tests to the logger
Date: Fri, 02 Oct 2026 10:10:16 +0200 [thread overview]
Message-ID: <DLU77KAH3ZBB.24374YTFBLM1U@proxmox.com> (raw)
In-Reply-To: <20260923115815.211083-4-t.ellmenreich@proxmox.com>
On Wed Sep 23, 2026 at 1:58 PM CEST, Thomas Ellmenreich wrote:
> Add tests to ensure consistent functionality when setting the logging
> environment variable, as well as global filtering of logs.
>
> Although the EnvFilter itself is not something we should be testing, we are
> adding some additional machinery, on top of the extensive functionality
> provided by tracing/tracing_subscriber, which does need testing.
>
[...]
> /// If present, tries to parse the `env_filter_str` as a [`EnvFilter`],
> /// otherwiese falls back to the provided default log level.
> ///
> @@ -170,3 +178,281 @@ impl Logger {
> }
> }
Thanks a lot for writing tests for this!
For completeness, you might also change some of the tests (or add 1-2
new ones) to emit native tracing events (e.g. tracing::info!), right now
you only emit log events (either directly through the `log` crate or
through `tracing_log::log`). The risk that one works and the other does
not is minimal, but while at it it certainly does not hurt.
Also please check `cargo clippy --tests`, there are some minor warnings
here (also about overindented documentation).
>
> +#[cfg(test)]
> +mod tests {
> + use std::sync::{Arc, Mutex};
> +
> + use tracing::level_filters::LevelFilter;
> + use tracing_log::log;
> + use tracing_subscriber::{Layer, util::SubscriberInitExt};
next prev parent reply other threads:[~2026-10-02 8:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 11:57 [RFC datacenter-manager/proxmox v2 0/4] log: allow finegrained control logging levels Thomas Ellmenreich
2026-09-23 11:57 ` [PATCH proxmox v2 1/4] log: replace per layer filtering by one global filter Thomas Ellmenreich
2026-10-02 8:10 ` Lukas Wagner
2026-09-23 11:58 ` [PATCH proxmox v2 2/4] fix #6081: log: replace simple level filter with env filter Thomas Ellmenreich
2026-10-02 8:10 ` Lukas Wagner
2026-09-23 11:58 ` [PATCH proxmox v2 3/4] log: add tests to the logger Thomas Ellmenreich
2026-10-02 8:10 ` Lukas Wagner [this message]
2026-09-23 11:58 ` [PATCH datacenter-manager v2 4/4] api: set REST server debug level based on actual log level Thomas Ellmenreich
2026-10-02 8:10 ` [RFC datacenter-manager/proxmox v2 0/4] log: allow finegrained control logging levels Lukas Wagner
2026-10-02 9:34 ` Thomas Ellmenreich
2026-10-02 9:44 ` Lukas Wagner
2026-10-02 10:00 ` Thomas Ellmenreich
2026-10-02 10:59 ` Lukas Wagner
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=DLU77KAH3ZBB.24374YTFBLM1U@proxmox.com \
--to=l.wagner@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
--cc=t.ellmenreich@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