diff options
author | Florian Klink <flokli@flokli.de> | 2024-10-30T12·11+0000 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-10-30T12·56+0000 |
commit | eb2ca5f07991cc526b22b1701896f40d38c46d46 (patch) | |
tree | b78046537270c47ada37e181d4224ff74f5bf138 /tvix/tracing | |
parent | 38f27c450205df431635c03936eb5ab70291a4fa (diff) |
refactor(tvix/tracing): drop log_level method r/8877
There's no more consumers left. Change-Id: I0585abbdbe0ffcf35cd20ac58077ade67cbf5c75 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12715 Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com> Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/tracing')
-rw-r--r-- | tvix/tracing/src/lib.rs | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/tvix/tracing/src/lib.rs b/tvix/tracing/src/lib.rs index 05a3468b93b8..41f294cf499a 100644 --- a/tvix/tracing/src/lib.rs +++ b/tvix/tracing/src/lib.rs @@ -1,7 +1,7 @@ use indicatif::ProgressStyle; use std::sync::LazyLock; use tokio::sync::{mpsc, oneshot}; -use tracing::Level; +use tracing::level_filters::LevelFilter; use tracing_indicatif::{ filter::IndicatifFilter, util::FilteredFormatFields, writer, IndicatifLayer, IndicatifWriter, }; @@ -145,34 +145,15 @@ impl TracingHandle { } } +#[derive(Default)] pub struct TracingBuilder { - level: Level, progess_bar: bool, #[cfg(feature = "otlp")] service_name: Option<&'static str>, } -impl Default for TracingBuilder { - fn default() -> Self { - TracingBuilder { - level: Level::INFO, - progess_bar: false, - - #[cfg(feature = "otlp")] - service_name: None, - } - } -} - impl TracingBuilder { - /// Set the log level for all layers: stderr und otlp if configured. RUST_LOG still has a - /// higher priority over this value. - pub fn level(mut self, level: Level) -> TracingBuilder { - self.level = level; - self - } - #[cfg(feature = "otlp")] /// Enable otlp by setting a custom service_name pub fn enable_otlp(mut self, service_name: &'static str) -> TracingBuilder { @@ -187,8 +168,7 @@ impl TracingBuilder { } /// This will setup tracing based on the configuration passed in. - /// It will setup a stderr writer output layer and a EnvFilter based on the provided log - /// level (RUST_LOG still has a higher priority over the configured value). + /// It will setup a stderr writer output layer and configure EnvFilter to honor RUST_LOG. /// The EnvFilter will be applied to all configured layers, also otlp. /// /// It will also configure otlp if the feature is enabled and a service_name was provided. It @@ -201,7 +181,7 @@ impl TracingBuilder { let subscriber = tracing_subscriber::registry() .with( EnvFilter::builder() - .with_default_directive(self.level.into()) + .with_default_directive(LevelFilter::INFO.into()) .from_env() .expect("invalid RUST_LOG"), ) |