From f2f399c2088662bcf6eea4145dc02a5c9ce9d81b Mon Sep 17 00:00:00 2001 From: Aswin V Date: Wed, 22 Jan 2025 15:52:15 +0530 Subject: [PATCH] Replace with logger --- npm/src/ee/product/index.ts | 8 ++++---- npm/src/index.ts | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/npm/src/ee/product/index.ts b/npm/src/ee/product/index.ts index b2c589a4a..c169a9b1b 100644 --- a/npm/src/ee/product/index.ts +++ b/npm/src/ee/product/index.ts @@ -1,12 +1,12 @@ import { JacksonError } from '../../controller/error'; import { throwIfInvalidLicense } from '../common/checkLicense'; -import type { Storable, JacksonOption, ProductConfig } from '../../typings'; +import type { Storable, ProductConfig, JacksonOptionWithRequiredLogger } from '../../typings'; export class ProductController { private productStore: Storable; - private opts: JacksonOption; + private opts: JacksonOptionWithRequiredLogger; - constructor({ productStore, opts }: { productStore: Storable; opts: JacksonOption }) { + constructor({ productStore, opts }: { productStore: Storable; opts: JacksonOptionWithRequiredLogger }) { this.productStore = productStore; this.opts = opts; } @@ -17,7 +17,7 @@ export class ProductController { const productConfig = (await this.productStore.get(productId)) as ProductConfig; // if (!productConfig) { - // console.error(`Product config not found for ${productId}`); + // this.opts.logger.error(`Product config not found for ${productId}`); // } return { diff --git a/npm/src/index.ts b/npm/src/index.ts index 864d58bfa..f6abd0738 100644 --- a/npm/src/index.ts +++ b/npm/src/index.ts @@ -110,7 +110,10 @@ export const controllers = async ( const ssoTraces = new SSOTraces({ tracesStore, opts }); const eventController = new EventController({ opts: opts as JacksonOptionWithRequiredLogger }); - const productController = new ProductController({ productStore, opts }); + const productController = new ProductController({ + productStore, + opts: opts as JacksonOptionWithRequiredLogger, + }); const connectionAPIController = new ConnectionAPIController({ connectionStore,