Skip to content

Commit

Permalink
Bit more logging cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rgwood committed Aug 30, 2024
1 parent cfe9cf4 commit b89e296
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async fn main() -> Result<()> {
}

let args = Args::parse();
initialize_logging(args.trace)?;
let _guard = initialize_logging(args.trace)?;
initialize_panic_handler();

// There's probably a nicer way to do this than defining the scope enum twice, but this is fine for now
Expand Down
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ pub fn initialize_logging(enable_tracing: bool) -> Result<WorkerGuard> {
.with_filter(EnvFilter::builder().with_default_directive(LevelFilter::INFO.into()).from_env_lossy());

let tui_layer = tui_logger::tracing_subscriber_layer()
.with_filter(EnvFilter::builder().with_default_directive(LevelFilter::INFO.into()).from_env_lossy());
.with_filter(EnvFilter::builder().with_default_directive(LevelFilter::INFO.into()).from_env_lossy());

tracing_subscriber::registry().with(file_layer).with(tui_layer).init();

if enable_tracing {
TRACING_ENABLED.store(true, std::sync::atomic::Ordering::Relaxed);
let mut trace_file = std::fs::File::create(&*TRACE_FILE_NAME).unwrap();
Expand Down

0 comments on commit b89e296

Please sign in to comment.