centralized logging for BWS and BCN.#4137
Open
tmcollins4 wants to merge 1 commit intobitpay:masterfrom
Open
Conversation
kajoseph
reviewed
Apr 10, 2026
Collaborator
kajoseph
left a comment
There was a problem hiding this comment.
I'm getting a few type errors in BWS:
The inferred type of 'logger' cannot be named without a reference to '@bitpay-labs/bitcore-logging/node_modules/winston'. This is likely not portable. A type annotation is necessary.
Removing declaration and declarationMap from BWS's tsconfig.json fixes it. BWS isn't an imported codebase, so we don't need TS to compile .d.ts files anyway.
| "name": "@bitpay-labs/bitcore-logging", | ||
| "description": "Centralized logging for Bitcore services", | ||
| "author": "BitPay Inc", | ||
| "version": "11.6.6", |
Collaborator
There was a problem hiding this comment.
Update to 11.7.0 to fix the build failing.
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
Centralized the duplicated Winston logging logic from
bitcore-node(BCN) andbitcore-wallet-service(BWS) into a new shared@bitpay-labs/bitcore-loggingpackage. This eliminates the duplication and gives a single place to evolve logging going forward.Changelog
packages/bitcore-logging/— new shared logging package withcreateLogger(config)factory, timestamp utilities, Winston format helpers, and Loggify decorators.createLogger({ prefix: 'BCN' | 'BWS' })reads existing env vars (BCN_LOG_*,BWS_LOG_*) — no configuration changes required.packages/bitcore-node/src/logger.tswith a thin shim delegating tobitcore-logging.packages/bitcore-node/src/decorators/Loggify.tswith a thin shim re-exporting frombitcore-logging.packages/bitcore-wallet-service/src/lib/logger.tswith a thin shim delegating tobitcore-logging.padEnd→padStartbug in millisecond formatting informatTimestamp.winstonas a direct dependency from BCN and BWS.Testing Notes
Checklist