fix: replace console.* and silent .catch(() => {}) with structured logging in TUI#791
Open
MrRealORG wants to merge 1 commit into
Open
fix: replace console.* and silent .catch(() => {}) with structured logging in TUI#791MrRealORG wants to merge 1 commit into
MrRealORG wants to merge 1 commit into
Conversation
…gging in TUI
Replace console.error/console.log calls with Log.create().error/debug
in TUI components for consistent structured logging. Replace silent
.catch(() => {}) with proper error logging in thread.ts (upgrade check),
dialog-worktree.tsx (instance dispose), and dialog-image-list.tsx
(backgrounds directory creation).
Files changed:
- app.tsx: 2x console.error -> log.error
- dialog-mcp.tsx: 2x console.error -> log.error
- plugin/slots.tsx: console.error -> log.error
- context/kv.tsx: 3x console.error -> log.error
- prompt/index.tsx: console.log -> log.error
- util/clipboard.ts: 6x console.log -> log.debug
- thread.ts: silent .catch -> log.error
- dialog-worktree.tsx: silent .catch -> log.error
- dialog-image-list.tsx: silent .catch -> log.error
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
Replace
console.error/console.logcalls withLog.create().error/debugin TUI components for consistent structured logging. Replace silent.catch(() => {})with proper error logging.Changes
app.tsxconsole.error→log.errordialog-mcp.tsxconsole.error→log.errorplugin/slots.tsxconsole.error→log.errorcontext/kv.tsxconsole.error→log.errorprompt/index.tsxconsole.log→log.errorutil/clipboard.tsconsole.log→log.debugthread.ts.catch(() => {})→log.errordialog-worktree.tsx.catch(() => {})→log.errordialog-image-list.tsx.catch(() => {})→log.errorMotivation
Log.create()utility instead of rawconsole.*, making logs searchable and filterable by service name..catch(() => {})patterns in worktree switching, background image directory creation, and upgrade checking now properly log errors for debugging.console.log("clipboard: using X")calls are replaced withlog.debug()which respects log level configuration.Testing
Verified no remaining
console.log/errorin the 9 changed files. AllLog.create()calls follow the existing pattern used elsewhere in the codebase (e.g.,config/tui.ts,plugin/runtime.ts).