Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Collaborator
b3fbf72 to
c460112
Compare
cameri
reviewed
Apr 18, 2026
cameri
reviewed
Apr 18, 2026
cameri
reviewed
Apr 18, 2026
There was a problem hiding this comment.
Pull request overview
This PR migrates runtime logging from debug/console.* to a centralized Pino-based logger, aiming to improve structured logging and observability across the app (workers, adapters, controllers, services, repositories, and utilities).
Changes:
- Introduces a centralized
src/logger.ts(Pino + dev pretty transport) and rewritescreateLoggerto wrap Pino while preserving existinglogger()/logger.debug()call patterns. - Refactors log call sites across runtime code to use
createLoggerinstead ofdebug/console.*, and adds/updates unit tests for the new logger factory behavior. - Updates tooling/deps (adds
pino,pino-pretty, removesdebug+ typings; enforces BiomenoConsolewith targeted overrides) and includes a Changeset.
Reviewed changes
Copilot reviewed 59 out of 60 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/utils/settings.spec.ts | Adjusts unit expectations around settings creation behavior. |
| test/unit/services/payments-service.spec.ts | Updates unit tests impacted by logging refactor. |
| test/unit/services/maintenance-service.spec.ts | Removes console-stub assertions tied to old logging approach. |
| test/unit/factories/logger-factory.spec.ts | Adds coverage for new Pino-backed createLogger wrapper behavior. |
| test/unit/app/maintenance-worker.spec.ts | Removes console-stub assertion in error-path test. |
| src/utils/sliding-window-rate-limiter.ts | Replaces legacy debug logger usage with new logger wrapper. |
| src/utils/settings.ts | Replaces debug/console calls with logger wrapper (including deprecation warning). |
| src/utils/nip05.ts | Migrates NIP-05 verification logging to new logger wrapper. |
| src/utils/http.ts | Replaces deprecation console.warn with logger wrapper. |
| src/tor/client.ts | Migrates Tor client debug/console logs to new logger wrapper. |
| src/services/payments-service.ts | Migrates service logging to new logger wrapper; replaces console.* usage. |
| src/services/maintenance-service.ts | Migrates maintenance logging to logger wrapper. |
| src/repositories/user-repository.ts | Migrates repository logging to logger wrapper and updates error logging. |
| src/repositories/nip05-verification-repository.ts | Migrates repository logging to logger wrapper. |
| src/repositories/invoice-repository.ts | Migrates repository logging to logger wrapper. |
| src/repositories/event-repository.ts | Migrates repository logging to logger wrapper. |
| src/payments-processors/zebedee-payments-processor.ts | Migrates processor logs to logger wrapper. |
| src/payments-processors/opennode-payments-processor.ts | Migrates processor logs to logger wrapper. |
| src/payments-processors/nodeless-payments-processor.ts | Migrates processor logs to logger wrapper. |
| src/payments-processors/lnurl-payments-processor.ts | Migrates processor logs to logger wrapper. |
| src/payments-processors/lnbits-payment-processor.ts | Migrates processor logs to logger wrapper. |
| src/logger.ts | Adds centralized Pino instance + dev pretty transport configuration. |
| src/handlers/subscribe-message-handler.ts | Migrates handler logging to logger wrapper. |
| src/handlers/request-handlers/rate-limiter-middleware.ts | Migrates middleware logging to logger wrapper. |
| src/handlers/event-strategies/vanish-event-strategy.ts | Migrates strategy logging to logger wrapper. |
| src/handlers/event-strategies/replaceable-event-strategy.ts | Migrates strategy logging to logger wrapper. |
| src/handlers/event-strategies/parameterized-replaceable-event-strategy.ts | Migrates strategy logging to logger wrapper. |
| src/handlers/event-strategies/gift-wrap-event-strategy.ts | Migrates strategy logging to logger wrapper. |
| src/handlers/event-strategies/ephemeral-event-strategy.ts | Migrates strategy logging to logger wrapper. |
| src/handlers/event-strategies/delete-event-strategy.ts | Migrates strategy logging to logger wrapper. |
| src/handlers/event-strategies/default-event-strategy.ts | Migrates strategy logging to logger wrapper. |
| src/handlers/event-message-handler.ts | Migrates handler logging to logger wrapper and adds error logging on catch. |
| src/factories/worker-factory.ts | Replaces console warnings with logger wrapper for deprecated settings. |
| src/factories/payments-processors/zebedee-payments-processor-factory.ts | Migrates factory error logging to logger wrapper. |
| src/factories/payments-processors/opennode-payments-processor-factory.ts | Migrates factory error logging to logger wrapper. |
| src/factories/payments-processors/nodeless-payments-processor-factory.ts | Migrates factory error logging to logger wrapper. |
| src/factories/payments-processors/lnbits-payments-processor-factory.ts | Migrates factory error logging to logger wrapper. |
| src/factories/payments-processor-factory.ts | Migrates factory logging to logger wrapper. |
| src/factories/logger-factory.ts | Replaces debug implementation with Pino-backed wrapper supporting formatting/child/extend. |
| src/database/client.ts | Replaces pool monitor console.log and config debug logs with logger wrapper. |
| src/controllers/invoices/post-invoice-controller.ts | Migrates controller logs to logger wrapper and cleans up error response formatting. |
| src/controllers/invoices/get-invoice-status-controller.ts | Migrates controller logs to logger wrapper. |
| src/controllers/callbacks/zebedee-callback-controller.ts | Migrates callback controller logs to logger wrapper. |
| src/controllers/callbacks/opennode-callback-controller.ts | Migrates callback controller logs to logger wrapper. |
| src/controllers/callbacks/nodeless-callback-controller.ts | Migrates callback controller logs to logger wrapper. |
| src/controllers/callbacks/lnbits-callback-controller.ts | Migrates callback controller logs to logger wrapper. |
| src/controllers/admission/get-admission-check-controller.ts | Migrates controller logs to logger wrapper. |
| src/cache/client.ts | Migrates cache client config logging to logger wrapper. |
| src/app/worker.ts | Migrates worker lifecycle/error logging to logger wrapper. |
| src/app/static-mirroring-worker.ts | Migrates mirroring worker logs to logger wrapper. |
| src/app/maintenance-worker.ts | Migrates maintenance worker logs to logger wrapper. |
| src/app/app.ts | Migrates primary app startup/banner/lifecycle logs to logger wrapper. |
| src/adapters/web-socket-server-adapter.ts | Migrates adapter logs to logger wrapper. |
| src/adapters/web-socket-adapter.ts | Migrates adapter logs to logger wrapper. |
| src/adapters/web-server-adapter.ts | Migrates adapter logs to logger wrapper. |
| src/adapters/redis-adapter.ts | Migrates redis adapter logs to logger wrapper and updates error logging. |
| package.json | Adds pino/pino-pretty and removes debug deps/types. |
| package-lock.json | Locks new Pino dependencies and removes debug-related packages. |
| biome.json | Enforces noConsole globally with overrides for scripts/migrations/tests. |
| .changeset/migrate-logging-to-pino.md | Adds a Changeset entry for the logging migration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cameri
approved these changes
Apr 19, 2026
This was referenced Apr 22, 2026
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.
Description
This PR fully migrates the project's logging from the legacy
debugmodule and directconsole.log/console.errorstatements to Pino — a fast, structured logging library.Key Changes:
pino(dependency) andpino-pretty(devDependency)src/logger.tswith proper configuration (pretty output in development, structured JSON in production, controlled byLOG_LEVEL)src/factories/logger-factory.tsto use Pino under the hood while preserving existing logger call patterns (logger.debug(),logger.info()etc.)console.*calls with structured Pino logging for better observabilitydebugand@types/debugpackages completelyRelated Issue
Closes #456
Motivation and Context
Migrating to Pino improves:
debug)This change also brings the branch up to date with the latest
mainbranch.How Has This Been Tested?
npm run build:checknpm run lintnpm run test:unit -- --reporter dotNo breaking changes to existing functionality. Logs now appear properly formatted when running the server locally.
Types of changes
Checklist: