Skip to content

feat(diagnostics): in-app log viewer in Wallet settings - #5

Merged
USCMig merged 1 commit into
mainfrom
feat/log-viewer
Aug 6, 2026
Merged

feat(diagnostics): in-app log viewer in Wallet settings#5
USCMig merged 1 commit into
mainfrom
feat/log-viewer

Conversation

@USCMig

@USCMig USCMig commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Nothing was subscribing to the app's tracing output, so diagnostics (including the new sync timing logs) went nowhere. Add a global subscriber that formats every event to stdout AND an in-memory ring buffer (logbuf.rs, bounded at 3000 lines, honouring RUST_LOG; default info + our crates at debug). The buffer is process-only and never written to disk — wallet logs can contain addresses/amounts.

New commands get_logs / clear_logs expose the buffer. Wallet settings gains a "Diagnostics log" card: live auto-refresh (2s), copy-all, refresh, clear, and a scroll-pinned monospace view — so a user can grab and share logs (e.g. the pipelined scan: … blocks/s lines) without a terminal.

logbuf unit tests cover ring-buffer capping/order and line splitting. Backend builds, tsc clean, no new clippy warnings.

Nothing was subscribing to the app's `tracing` output, so diagnostics
(including the new sync timing logs) went nowhere. Add a global subscriber that
formats every event to stdout AND an in-memory ring buffer (logbuf.rs,
bounded at 3000 lines, honouring RUST_LOG; default info + our crates at debug).
The buffer is process-only and never written to disk — wallet logs can contain
addresses/amounts.

New commands get_logs / clear_logs expose the buffer. Wallet settings gains a
"Diagnostics log" card: live auto-refresh (2s), copy-all, refresh, clear, and a
scroll-pinned monospace view — so a user can grab and share logs (e.g. the
`pipelined scan: … blocks/s` lines) without a terminal.

logbuf unit tests cover ring-buffer capping/order and line splitting. Backend
builds, tsc clean, no new clippy warnings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@USCMig
USCMig merged commit 1643e1d into main Aug 6, 2026
1 check passed
USCMig added a commit that referenced this pull request Aug 16, 2026
Brings the branch up to current main (active-wallet PR #4, log-viewer PR #5)
so it can open a clean PR. Two conflicts resolved:

- state.rs / wallet.rs: main added a global `sync_gate` (one wallet syncs at a
  time) via the active-wallet model; this branch had added a per-group
  `sync_locks` map to fix the "database is locked" race. The global gate is
  strictly stronger — only one sync ever runs — so it subsumes the per-group
  lock. Kept `sync_gate`, dropped `sync_locks` (and its now-unused Arc import).
  The db-lock fix is preserved: holding the gate across the whole sync_group
  call means a restarting sync can't race a cancelled one's open db connection.
- Kept this branch's `SyncOptions { batch_size, pipelined }` and the
  experimental pipelined-sync path (the point of the branch); only the locking
  mechanism changed.

The log-viewer commit (cherry-picked to main as PR #5) merges as identical
content — no duplicate get_logs/clear_logs. Backend + tsc build clean; clippy
unchanged at the 7-warning baseline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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