@@ -6,15 +6,15 @@ import { ConfigServiceInterface, EnvironmentVariablesService } from './config';
6
6
import {
7
7
Environment ,
8
8
HandlerMethodDecorator ,
9
- PowertoolLogData ,
9
+ LambdaFunctionContext ,
10
10
LogAttributes ,
11
11
ClassThatLogs ,
12
12
LoggerOptions ,
13
+ LogItemExtraInput ,
14
+ LogItemMessage ,
13
15
LogLevel ,
14
16
LogLevelThresholds ,
15
- LambdaFunctionContext ,
16
- LogItemMessage ,
17
- LogItemExtraInput ,
17
+ PowertoolLogData ,
18
18
} from '../types' ;
19
19
import { LogFormatterInterface , PowertoolLogFormatter } from './formatter' ;
20
20
@@ -33,7 +33,7 @@ class Logger implements ClassThatLogs {
33
33
private logLevel ?: LogLevel ;
34
34
35
35
private readonly logLevelThresholds : LogLevelThresholds = {
36
- 'DEBUG' : 8 ,
36
+ 'DEBUG' : 8 ,
37
37
'INFO' : 12 ,
38
38
'WARN' : 16 ,
39
39
'ERROR' : 20
@@ -99,7 +99,7 @@ class Logger implements ClassThatLogs {
99
99
}
100
100
101
101
public injectLambdaContext ( ) : HandlerMethodDecorator {
102
- return ( target , propertyKey , descriptor ) => {
102
+ return ( target , propertyKey , descriptor ) => {
103
103
const originalMethod = descriptor . value ;
104
104
105
105
descriptor . value = ( event , context , callback ) => {
@@ -166,7 +166,7 @@ class Logger implements ClassThatLogs {
166
166
const attributes = ( item instanceof Error ) ? { error : item } : item ;
167
167
logItem . addAttributes ( attributes ) ;
168
168
} ) ;
169
-
169
+
170
170
return logItem ;
171
171
}
172
172
@@ -228,7 +228,7 @@ class Logger implements ClassThatLogs {
228
228
}
229
229
230
230
private setCustomConfigService ( customConfigService ?: ConfigServiceInterface ) : void {
231
- this . customConfigService = customConfigService ? customConfigService : undefined ;
231
+ this . customConfigService = customConfigService ? customConfigService : undefined ;
232
232
}
233
233
234
234
private setEnvVarsService ( ) : void {
@@ -298,7 +298,7 @@ class Logger implements ClassThatLogs {
298
298
sampleRateValue : this . getSampleRateValue ( ) ,
299
299
serviceName : serviceName || this . getCustomConfigService ( ) ?. getServiceName ( ) || this . getEnvVarsService ( ) . getServiceName ( ) ,
300
300
xRayTraceId : this . getEnvVarsService ( ) . getXrayTraceId ( ) ,
301
- } , persistentLogAttributes ) ;
301
+ } , persistentLogAttributes ) ;
302
302
}
303
303
304
304
private shouldPrint ( logLevel : LogLevel ) : boolean {
0 commit comments