Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sinks/AgentSink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
6 changes: 3 additions & 3 deletions src/sinks/ConsoleSink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand All @@ -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<void> {
Expand Down