-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.d.ts
51 lines (44 loc) · 1.38 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
type Processor = (params: { level: Level; message: any; ctx: any; record: any }) => any;
type ProcessorFactory = (...args: any[]) => Processor;
type Transport = (params: { level: Level; record: any }) => any;
type TransportFactory = (...args: any[]) => Transport;
export class Level {
name: string;
method: string;
value: number;
satisfies(other: Level): boolean;
static TRACE: Level;
static DEBUG: Level;
static INFO: Level;
static WARN: Level;
static ERROR: Level;
static lookup(name: string): Level;
}
export class Logger {
constructor(options?: { level?: Level; processors?: ProcessorFactory[]; transports?: TransportFactory[] });
trace(message: String, context?: any): void;
debug(message: String, context?: any): void;
info(message: String, context?: any): void;
warn(message: String, context?: any): void;
error(message: String, context?: any): void;
error(context: Error): void;
enable(): void;
disable(): void;
waitForTransports(timeout?: number): Promise<void>;
}
export const processors: {
augment: ProcessorFactory;
buffer: ProcessorFactory;
context: ProcessorFactory;
empty: ProcessorFactory;
error: ProcessorFactory;
human: ProcessorFactory;
include: ProcessorFactory;
index: ProcessorFactory;
json: ProcessorFactory;
timestamp: ProcessorFactory;
};
export const transports: {
emitter: TransportFactory;
stream: TransportFactory;
};