Skip to content

Show human-readable timestamps in the server and daemon log viewer - #3454

Merged
andrewkchan merged 1 commit into
mainfrom
log-viewer-readable-timestamps
Sep 11, 2026
Merged

andrewkchan merged 1 commit into
mainfrom
log-viewer-readable-timestamps

Conversation

@andrewkchan

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The desktop "Open server and daemon logs" viewer printed raw pino JSON lines prefixed with [server]/[host-daemon], so timestamps showed as epoch milliseconds ("time":1789079985901) and levels as numbers ("level":40), making the log hard to scan.

What changed

  • apps/desktop/src/log-viewer.ts: new formatLogLine parses each tailed line as a pino record and renders YYYY-MM-DD HH:mm:ss.SSS [level] [component] msg {remaining fields} in local time. component is omitted when it matches the log file's component and shown as [host-daemon:<sub>] otherwise. Non-pino lines fall back to the previous [component] <raw line> format. Copy Logs uses the formatted text.
  • No wire, CLI, or protocol changes.

Example:

2026-09-09 09:25:59.311 [warn] [server] Failed to resolve host for provider discovery {"errorCode":"host_unavailable","errorMessage":"Host is not connected",...}

How you verified

  • Added formatLogLine tests in apps/desktop/test/log-viewer.test.ts (pino formatting, core-only records, differing sub-component, non-JSON / non-pino fallback); vitest run test/log-viewer.test.ts passes (11 tests).
  • pnpm exec turbo run typecheck --filter=@bb/desktop passes.
  • Not yet checked manually in the running desktop app.

AGENT GENERATED

🤖 Generated with Claude Code

Format pino JSON log lines as "YYYY-MM-DD HH:mm:ss.SSS [level] [component] msg {fields}"
using local time, falling back to the raw line for non-pino output.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@andrewkchan
andrewkchan merged commit be7c5c8 into main Sep 11, 2026
16 checks passed
@andrewkchan
andrewkchan deleted the log-viewer-readable-timestamps branch September 11, 2026 00:33
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