feat(devserver): Tee console output to a local dev log file#117486
Merged
Conversation
aa447e2 to
ebea711
Compare
The devserver now mirrors all honcho-routed console output to a log file (truncated each run) so it can be inspected after the fact — for example by AI agents reading the dev logs. ANSI color codes are stripped from the file copy while the interactive console keeps its coloring (the tee delegates isatty()). The path defaults to <repo>/.artifacts/dev.log and is configurable via the SENTRY_DEV_LOG_FILE environment variable. Both .artifacts/ and *.log are already gitignored. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ebea711 to
88bc69c
Compare
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
The devserver now mirrors all honcho-routed console output to a log file (truncated each run) so it can be inspected after the fact — for example, by AI agents reading the local dev logs.
TeeStreaminsentry/runner/formatting.pywraps stdout: it writes to the console verbatim and writes an ANSI-stripped copy to the log file, flushing each write.TeeStream.isatty()delegates to the underlying console so honcho still colorizes terminal output; only the file copy is stripped.get_honcho_printer(...)gains an optionaloutputparameter; the devserver passes it aTeeStream.<repo>/.artifacts/dev.logand is configurable via theSENTRY_DEV_LOG_FILEenvironment variable. Both.artifacts/and*.logare already gitignored.This mirrors an approach already in use in the seer repo.
Notes
server.run()path are not tee'd, which is fine for the intended use case.