1 | /**
|
2 | * @public
|
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" | "trace" | "debug" | "log" | "info" | "warn" | "error" | "off";
|
12 | /**
|
13 | * @public
|
14 | *
|
15 | * An object consumed by Logger constructor to initiate a logger object.
|
16 | */
|
17 | export interface LoggerOptions {
|
18 | logger?: Logger;
|
19 | logLevel?: LogLevel;
|
20 | }
|
21 | /**
|
22 | * @public
|
23 | *
|
24 | * Represents a logger object that is available in HandlerExecutionContext
|
25 | * throughout the middleware stack.
|
26 | */
|
27 | export interface Logger {
|
28 | trace?: (...content: any[]) => void;
|
29 | debug: (...content: any[]) => void;
|
30 | info: (...content: any[]) => void;
|
31 | warn: (...content: any[]) => void;
|
32 | error: (...content: any[]) => void;
|
33 | }
|