From d06cf2ffe940d8b55dab11b05b7c34a7384f0fa8 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Tue, 28 May 2024 15:17:08 +0530 Subject: [PATCH 1/3] chore: logging capability through metadata --- src/controllers/delivery.ts | 30 +++++++++++--- src/controllers/destination.ts | 46 +++++++++++++++------ src/helpers/metadata/binder.ts | 38 +++++++++++++++++ src/helpers/metadata/metadata.ts | 43 +++++++++++++++++++ src/helpers/metadata/types.ts | 71 ++++++++++++++++++++++++++++++++ src/types/index.ts | 51 +---------------------- 6 files changed, 212 insertions(+), 67 deletions(-) create mode 100644 src/helpers/metadata/binder.ts create mode 100644 src/helpers/metadata/metadata.ts create mode 100644 src/helpers/metadata/types.ts diff --git a/src/controllers/delivery.ts b/src/controllers/delivery.ts index 9e06b23f4d..df44dc3ec1 100644 --- a/src/controllers/delivery.ts +++ b/src/controllers/delivery.ts @@ -17,6 +17,7 @@ import { FixMe } from '../util/types'; import tags from '../v0/util/tags'; import { ControllerUtility } from './util'; import logger from '../logger'; +import MetaBinder from '../helpers/metadata/binder'; const NON_DETERMINABLE = 'Non-determinable'; @@ -28,6 +29,17 @@ export class DeliveryController { const deliveryRequest = ctx.request.body as ProxyV0Request; const { destination }: { destination: string } = ctx.params; const integrationService = ServiceSelector.getNativeDestinationService(); + const metaTO = integrationService.getTags( + destination, + deliveryRequest.metadata?.destinationId, + deliveryRequest.metadata?.workspaceId, + tags.FEATURES.PROCESSOR, + ); + MetaBinder.bindTransformMetaToDeliveryV0(deliveryRequest, { + module: metaTO.errorDetails.module, + implementation: metaTO.errorDetails.implementation, + feature: metaTO.errorDetails.feature, + }); try { deliveryResponse = (await integrationService.deliver( deliveryRequest, @@ -63,7 +75,18 @@ export class DeliveryController { const deliveryRequest = ctx.request.body as ProxyV1Request; const { destination }: { destination: string } = ctx.params; const integrationService = ServiceSelector.getNativeDestinationService(); + const metaTO = integrationService.getTags( + destination, + deliveryRequest.metadata[0].destinationId || NON_DETERMINABLE, + deliveryRequest.metadata[0].workspaceId || NON_DETERMINABLE, + tags.FEATURES.DATA_DELIVERY, + ); try { + MetaBinder.bindTransformMetaToDeliveryV1(deliveryRequest.metadata, { + module: metaTO.errorDetails.module, + implementation: metaTO.errorDetails.implementation, + feature: metaTO.errorDetails.feature, + }); deliveryResponse = (await integrationService.deliver( deliveryRequest, destination, @@ -72,12 +95,7 @@ export class DeliveryController { )) as DeliveryV1Response; } catch (error: any) { const { metadata } = deliveryRequest; - const metaTO = integrationService.getTags( - destination, - metadata[0].destinationId || NON_DETERMINABLE, - metadata[0].workspaceId || NON_DETERMINABLE, - tags.FEATURES.DATA_DELIVERY, - ); + metaTO.metadatas = metadata; deliveryResponse = DestinationPostTransformationService.handlevV1DeliveriesFailureEvents( error, diff --git a/src/controllers/destination.ts b/src/controllers/destination.ts index 998cab67bb..c04a75c7c2 100644 --- a/src/controllers/destination.ts +++ b/src/controllers/destination.ts @@ -16,6 +16,7 @@ import { checkInvalidRtTfEvents } from '../v0/util'; import tags from '../v0/util/tags'; import { ControllerUtility } from './util'; import logger from '../logger'; +import MetaBinder from '../helpers/metadata/binder'; export class DestinationController { public static async destinationTransformAtProcessor(ctx: Context) { @@ -34,6 +35,17 @@ export class DestinationController { const integrationService = ServiceSelector.getDestinationService(events); try { integrationService.init(); + const metaTO = integrationService.getTags( + destination, + events[0].metadata?.destinationId, + events[0].metadata?.workspaceId, + tags.FEATURES.PROCESSOR, + ); + MetaBinder.bindTransformMetaToTransformation(events, { + module: metaTO.errorDetails.module, + implementation: metaTO.errorDetails.implementation, + feature: metaTO.errorDetails.feature, + }); events = DestinationPreTransformationService.preProcess( events, ctx, @@ -114,7 +126,18 @@ export class DestinationController { }); const integrationService = ServiceSelector.getDestinationService(events); let resplist: RouterTransformationResponse[]; + const metaTO = integrationService.getTags( + destination, + events[0].metadata?.destinationId, + events[0].metadata?.workspaceId, + tags.FEATURES.ROUTER, + ); try { + MetaBinder.bindTransformMetaToTransformation(events, { + module: metaTO.errorDetails.module, + implementation: metaTO.errorDetails.implementation, + feature: metaTO.errorDetails.feature, + }); events = DestinationPreTransformationService.preProcess(events, ctx); const timestampCorrectEvents = ControllerUtility.handleTimestampInEvents(events); events = DynamicConfigParser.process(timestampCorrectEvents); @@ -125,12 +148,6 @@ export class DestinationController { requestMetadata, ); } catch (error: any) { - const metaTO = integrationService.getTags( - destination, - events[0].metadata?.destinationId, - events[0].metadata?.workspaceId, - tags.FEATURES.ROUTER, - ); metaTO.metadatas = events.map((ev) => ev.metadata); const errResp = DestinationPostTransformationService.handleRouterTransformFailureEvents( error, @@ -162,7 +179,18 @@ export class DestinationController { const destination = routerRequest.destType; let events = routerRequest.input; const integrationService = ServiceSelector.getDestinationService(events); + const metaTO = integrationService.getTags( + destination, + routerRequest.input[0].metadata.destinationId, + routerRequest.input[0].metadata.workspaceId, + tags.FEATURES.BATCH, + ); try { + MetaBinder.bindTransformMetaToTransformation(events, { + module: metaTO.errorDetails.module, + implementation: metaTO.errorDetails.implementation, + feature: metaTO.errorDetails.feature, + }); events = DestinationPreTransformationService.preProcess(events, ctx); const timestampCorrectEvents = ControllerUtility.handleTimestampInEvents(events); const resplist = integrationService.doBatchTransformation( @@ -173,12 +201,6 @@ export class DestinationController { ); ctx.body = resplist; } catch (error: any) { - const metaTO = integrationService.getTags( - destination, - events[0].metadata.destinationId, - events[0].metadata.workspaceId, - tags.FEATURES.BATCH, - ); metaTO.metadatas = events.map((ev) => ev.metadata); const errResp = DestinationPostTransformationService.handleBatchTransformFailureEvents( error, diff --git a/src/helpers/metadata/binder.ts b/src/helpers/metadata/binder.ts new file mode 100644 index 0000000000..b195abc373 --- /dev/null +++ b/src/helpers/metadata/binder.ts @@ -0,0 +1,38 @@ +/* eslint-disable no-param-reassign */ +import { ProxyV0Request } from '../../types'; +import { TransformationMetadata } from './metadata'; +import { Metadata, ProxyMetdata, TransformationKindInfo } from './types'; + +export default class MetaBinder { + // TODO: Update implementation for `implementation` so that it can be taken from input args + public static bindTransformMetaToDeliveryV0( + event: ProxyV0Request, + kindInfo: TransformationKindInfo, + ) { + const tfMetadata = new TransformationMetadata(event.metadata, kindInfo); + event.metadata.requestLog = tfMetadata.requestLog; + event.metadata.responseLog = tfMetadata.responseLog; + } + + public static bindTransformMetaToDeliveryV1( + metadatas: ProxyMetdata[], + kindInfo: TransformationKindInfo, + ) { + metadatas.forEach((metadata) => { + const tfMetadata = new TransformationMetadata(metadata, kindInfo); + metadata.requestLog = tfMetadata.requestLog; + metadata.responseLog = tfMetadata.responseLog; + }); + } + + public static bindTransformMetaToTransformation( + events: { metadata: Metadata }[], + kindInfo: TransformationKindInfo, + ) { + events.forEach((ev) => { + const tfMetadata = new TransformationMetadata(ev.metadata, kindInfo); + ev.metadata.requestLog = tfMetadata.requestLog; + ev.metadata.responseLog = tfMetadata.responseLog; + }); + } +} diff --git a/src/helpers/metadata/metadata.ts b/src/helpers/metadata/metadata.ts new file mode 100644 index 0000000000..2b07e14f87 --- /dev/null +++ b/src/helpers/metadata/metadata.ts @@ -0,0 +1,43 @@ +import logger from '../../logger'; +import { Metadata, ProxyMetdata, RequestInfo, ResponseInfo, TransformationKindInfo } from './types'; + +export class TransformationMetadata { + private m: Metadata | ProxyMetdata; + + private tfKind: TransformationKindInfo; + + constructor(m: Metadata | ProxyMetdata, tfKind: TransformationKindInfo) { + this.m = m; + this.tfKind = tfKind; + } + + private pickMetaInfo() { + const { sourceId, destinationId, workspaceId } = this.m; + const { module, feature, implementation } = this.tfKind; + return { + sourceId, + destinationId, + // destinationType, + workspaceId, + module, + feature, + implementation, + }; + } + + requestLog(identifierMsg: string, args: RequestInfo) { + // do something before if necessary + logger.debug(identifierMsg, { + ...this.pickMetaInfo(), + ...args, + }); + } + + responseLog(identifierMsg: string, args: ResponseInfo) { + // do something before if necessary + logger.debug(identifierMsg, { + ...this.pickMetaInfo(), + ...args, + }); + } +} diff --git a/src/helpers/metadata/types.ts b/src/helpers/metadata/types.ts new file mode 100644 index 0000000000..114030b079 --- /dev/null +++ b/src/helpers/metadata/types.ts @@ -0,0 +1,71 @@ +import { FixMe } from '../../util/types'; + +export type CommonMetadata = { + sourceId: string; + destinationId: string; + workspaceId: string; + + requestLog(msg: string, args: Record): void; + responseLog(msg: string, args: Record): void; +}; + +export type Metadata = CommonMetadata & { + namespace: string; + instanceId: string; + sourceType: string; + sourceCategory: string; + trackingPlanId: string; + trackingPlanVersion: number; + sourceTpConfig: object; + mergedTpConfig: object; + jobRunId: string; + jobId: number; + sourceBatchId: string; + sourceJobId: string; + sourceJobRunId: string; + sourceTaskId: string; + sourceTaskRunId: string; + recordId: object; + destinationType: string; + messageId: string; + oauthAccessToken: string; + messageIds: string[]; + rudderId: string; + receivedAt: string; + eventName: string; + eventType: string; + sourceDefinitionId: string; + destinationDefinitionId: string; + transformationId: string; + dontBatch?: boolean; +}; + +export type ProxyMetdata = CommonMetadata & { + jobId: number; + attemptNum: number; + userId: string; + secret: Record; + destInfo?: Record; + omitempty?: Record; + dontBatch: boolean; +}; + +export type TransformationKindInfo = { + module: string; + implementation: string; + feature: string; +}; + +export type TransformationMeta = CommonMetadata & TransformationKindInfo; + +export type RequestInfo = { + url: string; + body: FixMe; + method: string; +}; + +export type ResponseInfo = { + responseBody: FixMe; + status: number; + responseHeaders: Record; +}; diff --git a/src/types/index.ts b/src/types/index.ts index 68dfe3870d..202c930481 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,3 +1,4 @@ +import { ProxyMetdata, Metadata } from '../helpers/metadata/types'; import { CatchErr, FixMe } from '../util/types'; /* eslint-disable @typescript-eslint/no-explicit-any */ @@ -58,53 +59,6 @@ type ProxyV1Request = { type ProxyRequest = ProxyV0Request | ProxyV1Request; -type ProxyMetdata = { - jobId: number; - attemptNum: number; - userId: string; - sourceId: string; - destinationId: string; - workspaceId: string; - secret: Record; - destInfo?: Record; - omitempty?: Record; - dontBatch: boolean; -}; - -type Metadata = { - sourceId: string; - workspaceId: string; - namespace: string; - instanceId: string; - sourceType: string; - sourceCategory: string; - trackingPlanId: string; - trackingPlanVersion: number; - sourceTpConfig: object; - mergedTpConfig: object; - destinationId: string; - jobRunId: string; - jobId: number; - sourceBatchId: string; - sourceJobId: string; - sourceJobRunId: string; - sourceTaskId: string; - sourceTaskRunId: string; - recordId: object; - destinationType: string; - messageId: string; - oauthAccessToken: string; - messageIds: string[]; - rudderId: string; - receivedAt: string; - eventName: string; - eventType: string; - sourceDefinitionId: string; - destinationDefinitionId: string; - transformationId: string; - dontBatch?: boolean; -}; - type MessageIdMetadataMap = { [key: string]: Metadata; }; @@ -329,6 +283,7 @@ type SourceInput = { event: NonNullable[]; source?: Source; }; +export { Metadata, ProxyMetdata } from '../helpers/metadata/types'; export { ComparatorInput, DeliveryJobState, @@ -338,11 +293,9 @@ export { ErrorDetailer, MessageIdMetadataMap, MetaTransferObject, - Metadata, ProcessorTransformationOutput, ProcessorTransformationRequest, ProcessorTransformationResponse, - ProxyMetdata, ProxyRequest, ProxyV0Request, ProxyV1Request, From 50cc90326ae6086d3d1178ef802bd1402b52a2b5 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Tue, 28 May 2024 16:55:14 +0530 Subject: [PATCH 2/3] chore: metadata enabled logging for gaec --- .../networkHandler.js | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js b/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js index d795bc171c..03529982d1 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js +++ b/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js @@ -39,9 +39,10 @@ const getConversionActionId = async ({ method, headers, params, metadata }) => { query: queryString, }; const searchStreamEndpoint = `${BASE_ENDPOINT}/${params.customerId}/googleAds:searchStream`; - logger.requestLog(`[${destType.toUpperCase()}] conversion enhancement request`, { - metadata, - requestDetails: { url: searchStreamEndpoint, body: data, method }, + metadata?.requestLog(`[${destType.toUpperCase()}] conversion enhancement request`, { + url: searchStreamEndpoint, + body: data, + method, }); const requestBody = { url: searchStreamEndpoint, @@ -61,13 +62,10 @@ const getConversionActionId = async ({ method, headers, params, metadata }) => { }, ); const { status, response, headers: responseHeaders } = gaecConversionActionIdResponse; - logger.responseLog(`[${destType.toUpperCase()}] get conversion action id response`, { - metadata, - responseDetails: { - response, - status, - headers: responseHeaders, - }, + metadata?.responseLog(`[${destType.toUpperCase()}] get conversion action id response`, { + responseBody: response, + status, + responseHeaders, }); if (!isHttpStatusSuccess(status)) { throw new NetworkError( @@ -115,9 +113,10 @@ const ProxyRequest = async (request) => { 'conversionAdjustments[0].conversionAction', `customers/${params.customerId}/conversionActions/${conversionActionId}`, ); - logger.requestLog(`[${destType.toUpperCase()}] conversion enhancement request`, { - metadata, - requestDetails: { url: endpoint, body: body.JSON, method }, + metadata?.requestLog(`[${destType.toUpperCase()}] conversion enhancement request`, { + url: endpoint, + body: body.JSON, + method, }); const requestBody = { url: endpoint, data: body.JSON, headers, method }; const { httpResponse: response, processedResponse } = await handleHttpRequest( @@ -132,13 +131,10 @@ const ProxyRequest = async (request) => { }, ); const { response: processedResp, status, headers: responseHeaders } = processedResponse; - logger.responseLog(`[${destType.toUpperCase()}] conversion enhancement response`, { - metadata, - responseDetails: { - response: processedResp, - status, - headers: responseHeaders, - }, + metadata?.responseLog(`[${destType.toUpperCase()}] conversion enhancement response`, { + responseBody: processedResp, + status, + responseHeaders, }); return response; }; From 7253061686b9de5cbac860635e88dd8f6ea551d5 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Wed, 29 May 2024 12:03:06 +0530 Subject: [PATCH 3/3] chore: refactor log implementation using injection into metadata --- src/controllers/delivery.ts | 12 +-- src/helpers/metadata/binder.ts | 25 +++--- src/helpers/metadata/metadata.ts | 83 ++++++++++++------- src/helpers/metadata/types.ts | 22 ++++- .../networkHandler.js | 2 +- 5 files changed, 91 insertions(+), 53 deletions(-) diff --git a/src/controllers/delivery.ts b/src/controllers/delivery.ts index df44dc3ec1..e17d29caf6 100644 --- a/src/controllers/delivery.ts +++ b/src/controllers/delivery.ts @@ -49,12 +49,12 @@ export class DeliveryController { )) as DeliveryV0Response; } catch (error: any) { const { metadata } = deliveryRequest; - const metaTO = integrationService.getTags( - destination, - metadata?.destinationId || NON_DETERMINABLE, - metadata?.workspaceId || NON_DETERMINABLE, - tags.FEATURES.DATA_DELIVERY, - ); + // const metaTO = integrationService.getTags( + // destination, + // metadata?.destinationId || NON_DETERMINABLE, + // metadata?.workspaceId || NON_DETERMINABLE, + // tags.FEATURES.DATA_DELIVERY, + // ); metaTO.metadata = metadata; deliveryResponse = DestinationPostTransformationService.handleDeliveryFailureEvents( error, diff --git a/src/helpers/metadata/binder.ts b/src/helpers/metadata/binder.ts index b195abc373..5bae51569c 100644 --- a/src/helpers/metadata/binder.ts +++ b/src/helpers/metadata/binder.ts @@ -1,6 +1,6 @@ /* eslint-disable no-param-reassign */ import { ProxyV0Request } from '../../types'; -import { TransformationMetadata } from './metadata'; +import { requestLog, responseLog } from './metadata'; import { Metadata, ProxyMetdata, TransformationKindInfo } from './types'; export default class MetaBinder { @@ -9,20 +9,20 @@ export default class MetaBinder { event: ProxyV0Request, kindInfo: TransformationKindInfo, ) { - const tfMetadata = new TransformationMetadata(event.metadata, kindInfo); - event.metadata.requestLog = tfMetadata.requestLog; - event.metadata.responseLog = tfMetadata.responseLog; + // @ts-expect-error this assignment is necessary + event.metadata.requestLog = requestLog(event.metadata, kindInfo); + // @ts-expect-error this assignment is necessary + event.metadata.responseLog = responseLog(event.metadata, kindInfo); } public static bindTransformMetaToDeliveryV1( metadatas: ProxyMetdata[], kindInfo: TransformationKindInfo, ) { - metadatas.forEach((metadata) => { - const tfMetadata = new TransformationMetadata(metadata, kindInfo); - metadata.requestLog = tfMetadata.requestLog; - metadata.responseLog = tfMetadata.responseLog; - }); + // @ts-expect-error this assignment is necessary + metadatas.requestLog = requestLog(metadatas, kindInfo); + // @ts-expect-error this assignment is necessary + metadatas.responseLog = responseLog(metadatas, kindInfo); } public static bindTransformMetaToTransformation( @@ -30,9 +30,10 @@ export default class MetaBinder { kindInfo: TransformationKindInfo, ) { events.forEach((ev) => { - const tfMetadata = new TransformationMetadata(ev.metadata, kindInfo); - ev.metadata.requestLog = tfMetadata.requestLog; - ev.metadata.responseLog = tfMetadata.responseLog; + // @ts-expect-error this assignment is necessary + ev.metadata.requestLog = requestLog(ev.metadata, kindInfo); + // @ts-expect-error this assignment is necessary + ev.metadata.responseLog = responseLog(ev.metadata, kindInfo); }); } } diff --git a/src/helpers/metadata/metadata.ts b/src/helpers/metadata/metadata.ts index 2b07e14f87..1652ee7b7a 100644 --- a/src/helpers/metadata/metadata.ts +++ b/src/helpers/metadata/metadata.ts @@ -1,43 +1,64 @@ -import logger from '../../logger'; -import { Metadata, ProxyMetdata, RequestInfo, ResponseInfo, TransformationKindInfo } from './types'; - -export class TransformationMetadata { - private m: Metadata | ProxyMetdata; - - private tfKind: TransformationKindInfo; +/* eslint-disable @typescript-eslint/ban-ts-comment */ +// @ts-nocheck - constructor(m: Metadata | ProxyMetdata, tfKind: TransformationKindInfo) { - this.m = m; - this.tfKind = tfKind; - } - - private pickMetaInfo() { - const { sourceId, destinationId, workspaceId } = this.m; - const { module, feature, implementation } = this.tfKind; - return { - sourceId, - destinationId, - // destinationType, - workspaceId, - module, - feature, - implementation, - }; - } +import logger from '../../logger'; +import { + AllMetadata, + Metadata, + ProxyMetdata, + RequestInfo, + ResponseInfo, + TransformationKindInfo, +} from './types'; - requestLog(identifierMsg: string, args: RequestInfo) { +const pickMetaInfo = (m: Metadata | ProxyMetdata, tfKind: TransformationKindInfo) => { + const { sourceId, destinationId, workspaceId, jobId } = m; + const { module, feature, implementation } = tfKind; + return { + sourceId, + destinationId, + jobId, + // destinationType, + workspaceId, + module, + feature, + implementation, + }; +}; +export function requestLog(this: AllMetadata, kindInfo: TransformationKindInfo) { + return function internalReqLog(identifierMsg: string, args: RequestInfo) { // do something before if necessary + if (Array.isArray(this)) { + this.forEach((m) => { + logger.debug(identifierMsg, { + ...pickMetaInfo(m, kindInfo), + ...args, + }); + }); + return; + } logger.debug(identifierMsg, { - ...this.pickMetaInfo(), + ...pickMetaInfo(this, kindInfo), ...args, }); - } + }; +} - responseLog(identifierMsg: string, args: ResponseInfo) { +export function responseLog(this: AllMetadata, kindInfo: TransformationKindInfo) { + return function internalResLog(identifierMsg: string, args: ResponseInfo) { // do something before if necessary + if (Array.isArray(this)) { + this.forEach((m) => { + logger.debug(identifierMsg, { + ...pickMetaInfo(m, kindInfo), + ...args, + }); + }); + return; + } logger.debug(identifierMsg, { - ...this.pickMetaInfo(), + ...pickMetaInfo(this, kindInfo), ...args, }); - } + }; } diff --git a/src/helpers/metadata/types.ts b/src/helpers/metadata/types.ts index 114030b079..c355c0b938 100644 --- a/src/helpers/metadata/types.ts +++ b/src/helpers/metadata/types.ts @@ -1,12 +1,28 @@ import { FixMe } from '../../util/types'; +export type AllMetadata = Metadata | ProxyMetdata | Metadata[] | ProxyMetdata[]; + +export type MetadataT = { + requestLog( + m: AllMetadata, + kindInfo: TransformationKindInfo, + ): (msg: string, args: Record) => void; + responseLog( + m: AllMetadata, + kindInfo: TransformationKindInfo, + ): (msg: string, args: Record) => void; +} & (Metadata | ProxyMetdata | Metadata[] | ProxyMetdata[]); + +export interface MetadataI { + requestLog(msg: string, args: Record): void; + responseLog(msg: string, args: Record): void; +} + export type CommonMetadata = { sourceId: string; destinationId: string; workspaceId: string; - - requestLog(msg: string, args: Record): void; - responseLog(msg: string, args: Record): void; + jobId: number; }; export type Metadata = CommonMetadata & { diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js b/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js index 03529982d1..501ea9e279 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js +++ b/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js @@ -6,7 +6,7 @@ const { prepareProxyRequest, handleHttpRequest } = require('../../../adapters/ne const { isHttpStatusSuccess, getAuthErrCategoryFromStCode } = require('../../util/index'); const { CONVERSION_ACTION_ID_CACHE_TTL, destType } = require('./config'); const Cache = require('../../util/cache'); -const logger = require('../../../logger'); +// const logger = require('../../../logger'); const conversionActionIdCache = new Cache(CONVERSION_ACTION_ID_CACHE_TTL);