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'; 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 {