Upgrade tracing-subscriber

… and remove EnvFilterClone workaround.
This commit is contained in:
Jonas Platte 2025-09-16 10:48:45 +02:00
parent b5bc53bb2d
commit 412aaae106
No known key found for this signature in database
GPG key ID: 7D261D771D915378
6 changed files with 34 additions and 131 deletions

View file

@ -6,9 +6,10 @@
use std::path::PathBuf;
use clap::{Parser, Subcommand};
use tracing_subscriber::EnvFilter;
use crate::{
config::{default_tracing_filter, EnvFilterClone, LogFormat},
config::{default_tracing_filter, LogFormat},
error, observability,
};
@ -86,7 +87,7 @@ struct ObservabilityArgs {
/// For information about the syntax, see here:
/// <https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives>
#[clap(long, default_value_t = default_tracing_filter())]
log_filter: EnvFilterClone,
log_filter: EnvFilter,
}
#[derive(clap::Args)]
@ -98,7 +99,7 @@ pub(crate) struct ServeArgs {
impl Args {
pub(crate) async fn run(self) -> Result<(), error::Main> {
if let Some((format, filter)) = self.command.cli_observability_args() {
observability::init_for_cli(format, filter.into())?;
observability::init_for_cli(format, filter)?;
}
match self.command {
@ -110,7 +111,7 @@ impl Args {
}
impl Command {
fn cli_observability_args(&self) -> Option<(LogFormat, EnvFilterClone)> {
fn cli_observability_args(&self) -> Option<(LogFormat, EnvFilter)> {
// All subcommands other than `serve` should return `Some`. Keep these
// match arms sorted by the enum variant name.
match self {