From f6275a51429c2a072cdc90889f2c2b0712617abd Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Mon, 22 Dec 2025 15:59:30 -0800 Subject: [PATCH] chore(tui): include tracing targets in file logs (#8418) with_target(true) is the default for tracing-subscriber, but we previously disabled it for file output. Keep it enabled so we can selectively enable specific targets/events at runtime via RUST_LOG=..., and then grep by target/module in the log file during troubleshooting. before and after: image --- codex-rs/tui/src/lib.rs | 5 ++++- codex-rs/tui2/src/lib.rs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/codex-rs/tui/src/lib.rs b/codex-rs/tui/src/lib.rs index 5f34c6f62..bce9a350f 100644 --- a/codex-rs/tui/src/lib.rs +++ b/codex-rs/tui/src/lib.rs @@ -273,7 +273,10 @@ pub async fn run_main( let file_layer = tracing_subscriber::fmt::layer() .with_writer(non_blocking) - .with_target(false) + // `with_target(true)` is the default, but we previously disabled it for file output. + // Keep it enabled so we can selectively enable targets via `RUST_LOG=...` and then + // grep for a specific module/target while troubleshooting. + .with_target(true) .with_ansi(false) .with_span_events(tracing_subscriber::fmt::format::FmtSpan::FULL) .with_filter(env_filter()); diff --git a/codex-rs/tui2/src/lib.rs b/codex-rs/tui2/src/lib.rs index ce4f6d7b6..0e3c805fb 100644 --- a/codex-rs/tui2/src/lib.rs +++ b/codex-rs/tui2/src/lib.rs @@ -279,7 +279,10 @@ pub async fn run_main( let file_layer = tracing_subscriber::fmt::layer() .with_writer(non_blocking) - .with_target(false) + // `with_target(true)` is the default, but we previously disabled it for file output. + // Keep it enabled so we can selectively enable targets via `RUST_LOG=...` and then + // grep for a specific module/target while troubleshooting. + .with_target(true) .with_ansi(false) .with_span_events(tracing_subscriber::fmt::format::FmtSpan::CLOSE) .with_filter(env_filter());