chore: add electron-log for persistent file logging#28
Merged
Conversation
- Install electron-log v5.4.3 dependency - Create logger.ts module that initializes electron-log - Configure to write logs to ~/Library/Logs/Codez/main.log - Override console methods to capture all console.log/error output automatically - Enable spyRendererConsole to also capture renderer process logs - Import logger at app startup so all process startup logs are captured This addresses the issue where sessions stop mid-operation without any diagnostic logs. The next time this occurs, ~/Library/Logs/Codez/main.log will contain a complete history of what happened. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
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
Add persistent file logging via electron-log to diagnose why sessions stop mid-operation without warning.
What Changed
~/Library/Logs/Codez/main.logconsole.log/console.erroroutput automaticallyWhy
Previously, when sessions mysteriously stopped mid-operation, there were no logs to diagnose the cause. The main process would crash or restart, resetting all sessions to
idle, but we had no way to see what went wrong.With electron-log, every log message (including crash context from
node-pty,better-sqlite3, etc.) is now written to a persistent file. The next time this issue occurs,~/Library/Logs/Codez/main.logwill contain a complete diagnostic history.Testing
The logger is transparent to existing code — all existing
console.log/console.errorcalls are automatically captured without any modifications to those files.Next Steps
Monitor
~/Library/Logs/Codez/main.logon the next occurrence of sessions stopping mid-operation.