Skip to content

fix: add structured logging to frecency, stash, KV, clipboard, and remaining TUI console calls#786

Open
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-20260616-structured-logging-frecency-stash
Open

fix: add structured logging to frecency, stash, KV, clipboard, and remaining TUI console calls#786
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-20260616-structured-logging-frecency-stash

Conversation

@MrRealORG

Copy link
Copy Markdown

Summary

Replace all remaining bare console.log/error/warn in TUI code with structured Log.create() loggers. Files that previously silently swallowed IO errors with .catch(() => {}) now log the error with context (file path, error object), making file corruption and permission issues diagnosable from the log file.

Changes

  • frecency.tsx: Log file IO failures on init, append, and trim writes
  • stash.tsx: Log file IO failures on init rewrite, push, pop, and remove
  • kv.tsx: Log read/write failures for persistent KV state
  • clipboard.ts: Replace debug console.log method selection with log.debug (osascript, wl-copy, xclip, xsel, powershell, fallback)
  • app.tsx: Log clipboard copy failures and plugin load failures
  • prompt/index.tsx: Log session creation failures
  • dialog-mcp.tsx: Log MCP toggle and status refresh failures
  • plugin/slots.tsx: Log plugin slot errors

The plugin/runtime.ts dual logging (structured log + console) is intentionally preserved as it aids plugin developer debugging.

Closes #785
Closes #783

…maining TUI console calls

Replace all remaining bare console.log/error/warn in TUI code with
structured Log.create() loggers. This covers:

- frecency.tsx: log file IO failures on init, append, and trim writes
- stash.tsx: log file IO failures on init rewrite, push, pop, remove
- kv.tsx: log read/write failures for persistent KV state
- clipboard.ts: replace debug console.log method selection with log.debug
- app.tsx: log clipboard copy failures and plugin load failures
- prompt/index.tsx: log session creation failures
- dialog-mcp.tsx: log MCP toggle and status refresh failures
- plugin/slots.tsx: log plugin slot errors

The plugin/runtime.ts dual logging (log + console) is intentionally
preserved as it aids plugin developer debugging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant