From 9c6abbfc410fd90024fc8fe46c4954e1540494f5 Mon Sep 17 00:00:00 2001 From: Jason S Date: Thu, 21 Nov 2024 17:24:58 -0500 Subject: [PATCH 1/2] replaced removed import = and replaced with import from --- src/sinks/AgentSink.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sinks/AgentSink.ts b/src/sinks/AgentSink.ts index 99ea913..e00117c 100644 --- a/src/sinks/AgentSink.ts +++ b/src/sinks/AgentSink.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import url = require('url'); +import url from 'url'; import Configuration from '../config/Configuration'; import { MetricsContext } from '../logger/MetricsContext'; From 84e3481950446f6fbf845bf018a82e0237c0501d Mon Sep 17 00:00:00 2001 From: Jason S Date: Thu, 21 Nov 2024 17:25:38 -0500 Subject: [PATCH 2/2] removed importof Console and modified constructor to use global scope --- src/sinks/ConsoleSink.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sinks/ConsoleSink.ts b/src/sinks/ConsoleSink.ts index 0246865..a83394e 100644 --- a/src/sinks/ConsoleSink.ts +++ b/src/sinks/ConsoleSink.ts @@ -13,7 +13,6 @@ * limitations under the License. */ -import { Console } from 'console'; import { MetricsContext } from '../logger/MetricsContext'; import { LogSerializer } from '../serializers/LogSerializer'; import { ISerializer } from '../serializers/Serializer'; @@ -25,7 +24,6 @@ import { ISink } from './Sink'; */ export class ConsoleSink implements ISink { public readonly name: string = 'ConsoleSink'; - private serializer: ISerializer; public readonly console: Console; private static readonly AWS_LAMBDA_LOG_FORMAT = 'AWS_LAMBDA_LOG_FORMAT'; @@ -35,7 +33,9 @@ export class ConsoleSink implements ISink { // To avoid escaping EMF when using Lambda JSON log format we need to use Console() instead of console this.console = - process.env[ConsoleSink.AWS_LAMBDA_LOG_FORMAT] === 'JSON' ? new Console(process.stdout, process.stderr) : console; + process.env[ConsoleSink.AWS_LAMBDA_LOG_FORMAT] === 'JSON' + ? new console.Console(process.stdout, process.stderr) + : console; } public accept(context: MetricsContext): Promise {