Skip to content

feat(devserver): Tee console output to a local dev log file#117486

Merged
trevor-e merged 1 commit into
masterfrom
feat/tee-devserver-console-logs-to-dev-file
Jun 12, 2026
Merged

feat(devserver): Tee console output to a local dev log file#117486
trevor-e merged 1 commit into
masterfrom
feat/tee-devserver-console-logs-to-dev-file

Conversation

@trevor-e

Copy link
Copy Markdown
Member

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.

  • A new TeeStream in sentry/runner/formatting.py wraps stdout: it writes to the console verbatim and writes an ANSI-stripped copy to the log file, flushing each write.
  • The interactive console keeps its coloring — TeeStream.isatty() delegates to the underlying console so honcho still colorizes terminal output; only the file copy is stripped.
  • get_honcho_printer(...) gains an optional output parameter; the devserver passes it a TeeStream.
  • The log 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.

This mirrors an approach already in use in the seer repo.

Notes

  • This captures output that flows through honcho (all daemons: server, workers, webpack, consumers). Output emitted before honcho takes over and the bare no-daemon server.run() path are not tee'd, which is fine for the intended use case.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 11, 2026
@trevor-e trevor-e force-pushed the feat/tee-devserver-console-logs-to-dev-file branch 3 times, most recently from aa447e2 to ebea711 Compare June 11, 2026 23:30
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>
@trevor-e trevor-e force-pushed the feat/tee-devserver-console-logs-to-dev-file branch from ebea711 to 88bc69c Compare June 11, 2026 23:30
@trevor-e trevor-e marked this pull request as ready for review June 11, 2026 23:49
@trevor-e trevor-e requested a review from a team as a code owner June 11, 2026 23:49

@joshuarli joshuarli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@trevor-e trevor-e merged commit 0bef251 into master Jun 12, 2026
66 checks passed
@trevor-e trevor-e deleted the feat/tee-devserver-console-logs-to-dev-file branch June 12, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants