Skip to content

fix(logging): always capture debug logs to file while preserving console verbosity#430

Merged
jamesadevine merged 4 commits into
mainfrom
copilot/check-debug-logs-format
May 7, 2026
Merged

fix(logging): always capture debug logs to file while preserving console verbosity#430
jamesadevine merged 4 commits into
mainfrom
copilot/check-debug-logs-format

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 7, 2026

Summary

This PR addresses two logging gaps: debug artifacts were not consistently rich enough for post-mortem analysis, and log-path assumptions were too rigid. It makes file logs always debug-level while preserving operator-facing console verbosity, and aligns runtime/template log collection with configurable output directories.

  • File vs console log-level split

    • File sink now always captures DEBUG+.
    • Stderr remains filtered by runtime level (--debug / --verbose / default warn).
    • Logging max level is set to cover both sinks so debug records are not dropped before file write.
  • Configurable ado-aw log directory

    • Added global --log-output-dir.
    • Added ADO_AW_LOG_DIR support.
    • Resolution order: CLI override → env var → default (~/.ado-aw/logs).
  • Pipeline debug/log collection alignment

    • --debug-pipeline continues to control MCPG diagnostics/probing behavior.
    • Removed ado-aw runtime --debug injection ({{ ado_aw_debug_flags }} marker and usages).
    • Pipeline templates copy ado-aw logs from ADO_AW_LOG_DIR with $HOME/.ado-aw/logs fallback, instead of hard-coding only the default path.
  • Docs/tests

    • Updated CLI/template-marker documentation for the final marker behavior.
    • Updated debug-pipeline replacement tests for removed ado-aw debug marker.
    • Added unit coverage for stderr level selection behavior.
const FILE_LOG_LEVEL: LevelFilter = LevelFilter::Debug;

// file: always debug+, stderr: runtime-selected
if record.level() <= self.file_level { /* write file */ }
if record.level() <= self.stderr_level { eprint!("{}", message); }

Test plan

  • cargo test generate_debug_pipeline_replacements
  • cargo test test_debug_pipeline_
  • cargo build
  • cargo test
  • cargo clippy --all-targets --all-features

Copilot AI and others added 3 commits May 7, 2026 09:14
…-aw flags

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/78e8e09d-bd5a-43f7-83e6-6adf4097b88c

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
…resolution

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/78e8e09d-bd5a-43f7-83e6-6adf4097b88c

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
…err verbosity

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/fc1c4059-6c5b-40a3-b88d-c0a5baad0498

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
@jamesadevine
Copy link
Copy Markdown
Collaborator

@copilot Since the logging files are always at debug level, we do not need to set invocation debug level for --debug-pipeline case - I would propose we remove the template marker from the changes and retain the optional flag and env var.

@jamesadevine
Copy link
Copy Markdown
Collaborator

/rust-review

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 7, 2026

@copilot Since the logging files are always at debug level, we do not need to set invocation debug level for --debug-pipeline case - I would propose we remove the template marker from the changes and ...

Updated in 8473a38. I removed the {{ ado_aw_debug_flags }} template marker wiring and its template usages, while keeping --debug-pipeline support for MCPG diagnostics/probe behavior unchanged. There are no UI changes for this backend-only update.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • spsprodeus21.vssps.visualstudio.com
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-cd1c62e1a48d3b1f /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-cd1c62e1a48d3b1f e.0ljtill7i0wkanhjt77u3h9v4.1ogkyw7.rcgu.o e.0rhsulr6j4c555yzcd0qs3dw9.1ogkyw7.rcgu.o e.10l4qgv5mvaemvqhd5eovjw21.1ogkyw7.rcgu.o e.1i8atv3sxyab99ua9lslm38pr.1ogkyw7.rcgu.o e.1mjo6mxrll6gvzaohotq6qcy3.1ogkyw7.rcgu.o e.1p3gs6jqaroyfw15nw5xu68xe.1ogkyw7.rcgu.o e.1ru48e43nhploww2s4f1zze6m.1ogkyw7.rcgu.o e.22tjj8mpebzl4qvktqlcj60ni.1ogkyw7.rcgu.o e.260d3d6adauswid38ldy735a4.1ogkyw7.rcgu.o e.27m2f5uyr00xd1gdj60h45w5r.1ogkyw7.rcgu.o e.2lybomqu9cggouixjm0qucwmc.1ogkyw7.rcgu.o e.2n�� e.2q01b6rxociofj68yobiu3a2p.1ogkyw7.rcgu.o e.2rg2f4ujbowlq276jdp3l9wi9.1ogkyw7.rcgu.o lib/rustlib/x86_/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/async_trait-f6d12dc65cce50cb.a--noprofile lib/rustlib/x86_git lib/rustlib/x86_remote lib/rustlib/x86_get-url lib/rustlib/x86_origin (dns block)
  • spsprodweu4.vssps.visualstudio.com
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-cd1c62e1a48d3b1f /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-cd1c62e1a48d3b1f e.0ljtill7i0wkanhjt77u3h9v4.1ogkyw7.rcgu.o e.0rhsulr6j4c555yzcd0qs3dw9.1ogkyw7.rcgu.o e.10l4qgv5mvaemvqhd5eovjw21.1ogkyw7.rcgu.o e.1i8atv3sxyab99ua9lslm38pr.1ogkyw7.rcgu.o e.1mjo6mxrll6gvzaohotq6qcy3.1ogkyw7.rcgu.o e.1p3gs6jqaroyfw15nw5xu68xe.1ogkyw7.rcgu.o e.1ru48e43nhploww2s4f1zze6m.1ogkyw7.rcgu.o e.22tjj8mpebzl4qvktqlcj60ni.1ogkyw7.rcgu.o e.260d3d6adauswid38ldy735a4.1ogkyw7.rcgu.o e.27m2f5uyr00xd1gdj60h45w5r.1ogkyw7.rcgu.o e.2lybomqu9cggouixjm0qucwmc.1ogkyw7.rcgu.o e.2n�� e.2q01b6rxociofj68yobiu3a2p.1ogkyw7.rcgu.o e.2rg2f4ujbowlq276jdp3l9wi9.1ogkyw7.rcgu.o lib/rustlib/x86_/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/async_trait-f6d12dc65cce50cb.a--noprofile lib/rustlib/x86_git lib/rustlib/x86_remote lib/rustlib/x86_get-url lib/rustlib/x86_origin (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title fix(logging): always capture debug logs to file while keeping console verbosity scoped fix(logging): always capture debug logs to file while preserving console verbosity May 7, 2026
Copilot AI requested a review from jamesadevine May 7, 2026 10:06
@jamesadevine jamesadevine merged commit 64e9709 into main May 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants