File tree 3 files changed +44
-1
lines changed 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ export * from './client';
3
3
export * from './credentials' ;
4
4
export * from './crypto' ;
5
5
export * from './http' ;
6
+ export * from './logger' ;
6
7
export * from './marshaller' ;
7
8
export * from './middleware' ;
8
9
export * from './protocol' ;
Original file line number Diff line number Diff line change
1
+ import { Shape , Member } from './protocol'
2
+
3
+ /**
4
+ * A list of logger's log level. These levels are sorted in
5
+ * order of increasing severity. Each log level includes itself and all
6
+ * the levels behind itself.
7
+ *
8
+ * @example new Logger({logLevel: 'warn'}) will print all the warn and error
9
+ * message.
10
+ */
11
+ export type LogLevel = 'all' | 'log' | 'info' | 'warn' | 'error' | 'off'
12
+
13
+ /**
14
+ * An object consumed by Logger constructor to initiate a logger object.
15
+ */
16
+ export interface LoggerOptions {
17
+ logger ?: Logger ;
18
+ logLevel ?: LogLevel ;
19
+ }
20
+
21
+ /**
22
+ * Represents a logger object that is available in HandlerExecutionContext
23
+ * throughout the middleware stack.
24
+ */
25
+ export interface Logger {
26
+ log ( content : string ) : void ;
27
+ info ( content : string ) : void ;
28
+ warn ( content : string ) : void ;
29
+ error ( content : string ) : void ;
30
+ }
31
+
32
+ /**
33
+ * A function that removes the sensitive information from input parameters
34
+ * and output objects being logged. Meanwhile this function will output
35
+ * stringified object
36
+ *
37
+ * This function is mainly used in logging middleware.
38
+ */
39
+ export interface SensitiveDataScrubber {
40
+ ( input : any , shape : Member ) : string
41
+ }
Original file line number Diff line number Diff line change 4
4
HttpRequest
5
5
} from './http' ;
6
6
import { OperationModel } from './protocol' ;
7
+ import { Logger } from './logger'
7
8
8
9
export interface HandlerArguments <
9
10
InputType extends object ,
@@ -165,7 +166,7 @@ export interface HandlerExecutionContext {
165
166
/**
166
167
* TODO Define a logger interface
167
168
*/
168
- logger : any ;
169
+ logger : Logger ;
169
170
170
171
/**
171
172
* The serialization model for the input, output, and possible errors for
You can’t perform that action at this time.
0 commit comments