From d65580cd6cb356d11498fd8dece33d6ac0744256 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Tue, 23 Jul 2024 13:46:49 +0700 Subject: [PATCH] chore(dapi): enable logger for reconnectable stream --- packages/js-dapi-client/lib/DAPIClient.js | 14 +++++++++----- .../createMasternodeListStreamFactory.js | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/js-dapi-client/lib/DAPIClient.js b/packages/js-dapi-client/lib/DAPIClient.js index f939cbddd4..ed8c80d753 100644 --- a/packages/js-dapi-client/lib/DAPIClient.js +++ b/packages/js-dapi-client/lib/DAPIClient.js @@ -39,7 +39,15 @@ class DAPIClient extends EventEmitter { ...options, }; - this.dapiAddressProvider = createDAPIAddressProviderFromOptions(this.options); + this.logger = logger.getForId( + this.options.loggerOptions.identifier, + this.options.loggerOptions.level, + ); + + this.dapiAddressProvider = createDAPIAddressProviderFromOptions({ + ...this.options, + logger: this.logger, + }); const grpcTransport = new GrpcTransport( createDAPIAddressProviderFromOptions, @@ -58,10 +66,6 @@ class DAPIClient extends EventEmitter { this.core = new CoreMethodsFacade(jsonRpcTransport, grpcTransport); this.platform = new PlatformMethodsFacade(grpcTransport); - this.logger = logger.getForId( - this.options.loggerOptions.identifier, - this.options.loggerOptions.level, - ); this.initBlockHeadersProvider(); } diff --git a/packages/js-dapi-client/lib/SimplifiedMasternodeListProvider/createMasternodeListStreamFactory.js b/packages/js-dapi-client/lib/SimplifiedMasternodeListProvider/createMasternodeListStreamFactory.js index fca1a8e6c7..a80bd3feff 100644 --- a/packages/js-dapi-client/lib/SimplifiedMasternodeListProvider/createMasternodeListStreamFactory.js +++ b/packages/js-dapi-client/lib/SimplifiedMasternodeListProvider/createMasternodeListStreamFactory.js @@ -42,6 +42,7 @@ function createMasternodeListStreamFactory( ), { maxRetriesOnError: -1, + logger: options.logger, }, ); }