Quiet terminal output by default (opt-in verbose logging)#21
Merged
Conversation
The Electron main process logged every event (startup, focus/blur, memory stats) to the terminal, and Chromium printed GPU/init errors, cluttering the console on `npm start`. - log() now only echoes to the terminal when verbose logging is enabled (--verbose/--debug flag or JLMOL_DEBUG=1); the full jsmol.log file is always written for troubleshooting. - Suppress Chromium's own ERROR/INFO output (log-level=3) unless verbose or --enable-logging is set. - Add `npm run start-verbose` and wrap the log write in try/catch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
npm startfloods the terminal with the main process's per-event log (startup info, focus/blur, memory stats) and Chromium's GPU/initERRORlines, e.g.:Fix
log()now only echoes to the terminal when verbose logging is enabled. The fulljsmol.logfile (in the app's user-data directory) is always written, so troubleshooting info is preserved.--log-level=3, fatal only) unless verbose/--enable-loggingis set — this removes the GPU initERRORnoise.--verbose/--debug,JLMOL_DEBUG=1, or the newnpm run start-verbosescript.Note: this is gated by a CLI flag / env var rather than the in-app Settings, because the main-process logging runs at startup before the renderer (where preferences live in
localStorage) is available.Testing
node --check main.jsandpackage.jsonJSON both validate.npm startshould now be quiet;npm run start-verboserestores the detailed terminal log.🤖 Generated with Claude Code