mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
feat(core): add configurable log_dir (#10678)
Adds a top-level `log_dir` config key (defaults to `$CODEX_HOME/log`) so one-off runs can redirect `codex-tui.log` via `-c`, e.g.: codex -c log_dir=./.codex-log Also resolves relative paths in CLI `-c/--config` overrides for `AbsolutePathBuf` values against the effective cwd (when available). Tests: - cargo test -p codex-core
This commit is contained in:
committed by
GitHub
Unverified
parent
0e8d359da9
commit
cddfd1e675
+1
-1
@@ -51,7 +51,7 @@ cargo test --all-features
|
||||
|
||||
Codex is written in Rust, so it honors the `RUST_LOG` environment variable to configure its logging behavior.
|
||||
|
||||
The TUI defaults to `RUST_LOG=codex_core=info,codex_tui=info,codex_rmcp_client=info` and log messages are written to `~/.codex/log/codex-tui.log`, so you can leave the following running in a separate terminal to monitor log messages as they are written:
|
||||
The TUI defaults to `RUST_LOG=codex_core=info,codex_tui=info,codex_rmcp_client=info` and log messages are written to `~/.codex/log/codex-tui.log` by default. For a single run, you can override the log directory with `-c log_dir=...` (for example, `-c log_dir=./.codex-log`).
|
||||
|
||||
```bash
|
||||
tail -F ~/.codex/log/codex-tui.log
|
||||
|
||||
@@ -32,6 +32,8 @@ RUST_LOG='codex_tui::streaming::commit_tick=trace,codex_tui=info,codex_core=info
|
||||
|
||||
## Log capture process
|
||||
|
||||
Tip: for one-off measurements, run with `-c log_dir=...` to direct logs to a fresh directory and avoid mixing sessions.
|
||||
|
||||
1. Record the current size of `~/.codex/log/codex-tui.log` as a start offset.
|
||||
2. Run an interactive prompt that produces sustained streamed output.
|
||||
3. Stop the run.
|
||||
|
||||
Reference in New Issue
Block a user