Skip to content

Commit

Permalink
use filter for build_logger_text only
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Jan 16, 2024
1 parent a0f1b6c commit 70b43b8
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,13 @@ pub fn init_tracing_with_fallbacks(
propagation::TextMapSplitPropagator::default(),
);

let level_filter: LevelFilter = max(log_level, tracing::Level::TRACE).into();
let subscriber = tracing_subscriber::registry()
.with(level_filter)
.with(build_logger_text(log_level));
let _guard = tracing::subscriber::set_default(subscriber);
tracing::info!("init logging & tracing");

let level_filter: LevelFilter = max(log_level, log_level).into();
let otel_layer = tracing_opentelemetry::layer().with_tracer(otel_tracer);

let subscriber = tracing_subscriber::registry()
.with(build_logger_text(log_level))
.with(otel_layer)
.with(level_filter);
.with(level_filter)
.with(build_logger_text(log_level));
tracing::subscriber::set_global_default(subscriber).unwrap();
}

Expand Down

0 comments on commit 70b43b8

Please sign in to comment.