feat(cli): add --debug flag to write all trace logs to ./debug.txt#296
Merged
feat(cli): add --debug flag to write all trace logs to ./debug.txt#296
Conversation
This adds a --debug flag that enables comprehensive debug logging to help troubleshoot issues when the agent doesn't return expected output. When --debug is passed: - All trace-level logs are written to ./debug.txt in the current directory - Logs include module paths, thread IDs, thread names, source files, and line numbers - Non-blocking writer is used for performance - A message is printed to stderr confirming the debug file location This is useful for diagnosing issues in both TUI and non-TUI modes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a
--debugflag that enables comprehensive debug logging to help troubleshoot issues when the agent doesn't return expected output.Changes
New
--debugflagWhen
--debugis passed:./debug.txtin the current working directoryUsage
The generated
debug.txtfile will contain all Rust tracing events and internal diagnostics, which is invaluable for troubleshooting when the agent doesn't produce expected output.Implementation Details
tracing-appenderfor non-blocking file writingtraceto capture everything