@@ -4,11 +4,12 @@ import {
44 PutLogEventsCommand ,
55} from '@aws-sdk/client-cloudwatch-logs' ;
66import * as process from 'process' ;
7- import moment from 'moment' ;
7+ const moment = require ( 'moment-timezone' ) ;
88
99const { createLogger, format, transports } = winston ;
1010const { combine, timestamp, colorize, printf, simple, json, logstash } =
1111 winston . format ;
12+ const now = moment ( ) . format ( 'YYYY-MM-DD HH:mm:ss' ) ;
1213
1314export default class Logger {
1415 private logger : winston . Logger ;
@@ -66,7 +67,6 @@ export default class Logger {
6667 }
6768
6869 public info ( msg : string , metadata : string = '' ) {
69- const now = moment ( ) . format ( 'YYYY-MM-DD HH:mm:ss' ) ;
7070 this . logger . info ( msg ) ;
7171 if ( this . is_production ) {
7272 const info = {
@@ -80,7 +80,6 @@ export default class Logger {
8080 }
8181 }
8282 public error ( errMsg : string , metadata : string = '' ) {
83- const now = moment ( ) . format ( 'YYYY-MM-DD HH:mm:ss' ) ;
8483 this . logger . error ( errMsg ) ;
8584 if ( this . is_production ) {
8685 const info = {
@@ -97,7 +96,6 @@ export default class Logger {
9796 this . logger . debug ( debugMsg ) ;
9897 }
9998 public warn ( warnMsg : string , metadata : string = '' ) {
100- const now = moment ( ) . format ( 'YYYY-MM-DD HH:mm:ss' ) ;
10199 this . logger . warn ( warnMsg ) ;
102100 if ( this . is_production ) {
103101 const info = {
0 commit comments