feat(diagnostics): always-on local error log for Release builds - #243
Merged
Conversation
Adds DiagnosticsLog (vendor/bonsplit), an always-on (not #if DEBUG), local-only file log, so socket disconnects and listener errors leave evidence in Release builds instead of only in the Debug-only DebugEventLog. No network calls, no settings toggle. Instruments TerminalController's socket accept loop, listener start/stop, per-connection open/close (with a close reason), and event-subscription teardown with dilog() calls.
- sanitize newlines in logged values so nothing (e.g. a hostile path in an env override) can forge log records; one record per line, always - create the log file 0600 - replace the tests' 200ms sleep drain with a real flush() seam that syncs the write queue; also useful before collecting the log for a bug report Rejected from the same review, for the record: an autoclosure API (no level filtering exists, so nothing would ever skip evaluation; all call sites are low-frequency socket lifecycle events) and cross-process file locking (two instances sharing the default path can interleave an error log's lines; that is acceptable, and tagged builds can point PROGRAMA_DIAGNOSTICS_LOG elsewhere).
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.
What this does
Gives Release builds a way to leave evidence when something breaks. Until now every log line in the app was #if DEBUG, so reports like 'sockets are unstable losing connection constantly' arrive with zero data. This adds a small always-on diagnostics log and instruments the socket subsystem first, since that is the open bug we cannot see.
Not telemetry: plain file on the user's machine, nothing ever leaves it. No settings toggle either, it is just on (error-level metadata only).
Review order
Test plan