From dfd62410b8f2ffee5771e0a8de4a847c7af5bfe8 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Thu, 11 Jul 2024 13:57:14 +0200 Subject: [PATCH] fix: separate yagna-api related logs to a child namespace for readability --- src/shared/yagna/yagnaApi.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/yagna/yagnaApi.ts b/src/shared/yagna/yagnaApi.ts index 2a3cc1c99..01058adc3 100644 --- a/src/shared/yagna/yagnaApi.ts +++ b/src/shared/yagna/yagnaApi.ts @@ -135,6 +135,7 @@ export class YagnaApi { eventSource.addEventListener("runtime", (event) => observer.next(JSON.parse(event.data))); eventSource.addEventListener("error", (error) => observer.error(error)); + return () => eventSource.close(); }); }, @@ -155,7 +156,7 @@ export class YagnaApi { this.gsb = gsbClient.requestor; - this.logger = options?.logger ?? defaultLogger("yagna"); + this.logger = options?.logger ? options.logger.child("yagna") : defaultLogger("yagna"); const identityClient = new YaTsClient.IdentityApi.Client({ BASE: this.basePath,