Skip to content

refactor(logging): adopt pino logger across daemon, memory, ingest, sdk#52

Merged
meidad merged 1 commit into
mainfrom
refactor/pino-logger
May 26, 2026
Merged

refactor(logging): adopt pino logger across daemon, memory, ingest, sdk#52
meidad merged 1 commit into
mainfrom
refactor/pino-logger

Conversation

@meidad
Copy link
Copy Markdown
Collaborator

@meidad meidad commented May 26, 2026

Replace ad-hoc console.log/error/warn calls with a centralized pino-based logger (src/lib/logger.ts) that pretty-prints in development and emits JSON in production. Every module gets a child logger keyed on its name via createLogger("module-name"); bracket prefixes like "[cron-engine]" are dropped since the module context now lives in the log record.

Errors are passed as { err } so pino's stdSerializers.err formats stack traces correctly. Multi-arg console calls become structured fields. CLI commands (src/cli/) and Ink UI (src/ui/) keep console.log because their chalk-styled output is intentional terminal UX.

Also clears 11 pre-existing oxlint warnings:

  • Drops dead variables/imports (diskPath, existingPaths, gwsServices, clientSecretPath, MARKETPLACE_BASE, readdir, execAsync, label).
  • Replaces the [...buffers.keys()] spread in flushAll() with a named Array.from() snapshot (the copy is intentional: flush() mutates buffers mid-loop) so the rule no longer fires.
  • Swaps NUL-byte sentinels in slack-mrkdwn for U+E000 (Private Use Area) so the no-control-regex rule is satisfied without weakening the "won't collide with real text" guarantee.

pnpm typecheck, pnpm lint (0/0), pnpm test (269/269), pnpm build all pass.

Summary

Changes

Test plan

  • pnpm check passes (format, typecheck, lint)
  • pnpm test passes
  • Manual testing done

Related issues

Replace ad-hoc console.log/error/warn calls with a centralized pino-based
logger (src/lib/logger.ts) that pretty-prints in development and emits
JSON in production. Every module gets a child logger keyed on its name
via createLogger("module-name"); bracket prefixes like "[cron-engine]"
are dropped since the module context now lives in the log record.

Errors are passed as { err } so pino's stdSerializers.err formats stack
traces correctly. Multi-arg console calls become structured fields. CLI
commands (src/cli/*) and Ink UI (src/ui/*) keep console.log because
their chalk-styled output is intentional terminal UX.

Also clears 11 pre-existing oxlint warnings:
  - Drops dead variables/imports (diskPath, existingPaths, gwsServices,
    clientSecretPath, MARKETPLACE_BASE, readdir, execAsync, label).
  - Replaces the [...buffers.keys()] spread in flushAll() with a named
    Array.from() snapshot (the copy is intentional: flush() mutates
    buffers mid-loop) so the rule no longer fires.
  - Swaps NUL-byte sentinels in slack-mrkdwn for U+E000 (Private Use
    Area) so the no-control-regex rule is satisfied without weakening
    the "won't collide with real text" guarantee.

pnpm typecheck, pnpm lint (0/0), pnpm test (269/269), pnpm build all
pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@meidad meidad marked this pull request as ready for review May 26, 2026 05:44
@meidad meidad merged commit 937cb85 into main May 26, 2026
6 checks passed
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