mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 08:11:24 +01:00
Upgrade tracing-subscriber
… and remove EnvFilterClone workaround.
This commit is contained in:
parent
b5bc53bb2d
commit
412aaae106
6 changed files with 34 additions and 131 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue