1 | export declare type LogLevel = 'log' | 'error' | 'warn' | 'debug' | 'verbose';
|
2 | export interface LoggerService {
|
3 | |
4 |
|
5 |
|
6 | log(message: any, ...optionalParams: any[]): any;
|
7 | |
8 |
|
9 |
|
10 | error(message: any, ...optionalParams: any[]): any;
|
11 | |
12 |
|
13 |
|
14 | warn(message: any, ...optionalParams: any[]): any;
|
15 | |
16 |
|
17 |
|
18 | debug?(message: any, ...optionalParams: any[]): any;
|
19 | |
20 |
|
21 |
|
22 | verbose?(message: any, ...optionalParams: any[]): any;
|
23 | |
24 |
|
25 |
|
26 |
|
27 | setLogLevels?(levels: LogLevel[]): any;
|
28 | }
|
29 | interface LogBufferRecord {
|
30 | |
31 |
|
32 |
|
33 | methodRef: Function;
|
34 | |
35 |
|
36 |
|
37 | arguments: unknown[];
|
38 | }
|
39 | export declare class Logger implements LoggerService {
|
40 | protected context?: string;
|
41 | protected options: {
|
42 | timestamp?: boolean;
|
43 | };
|
44 | protected static logBuffer: LogBufferRecord[];
|
45 | protected static staticInstanceRef?: LoggerService;
|
46 | protected static logLevels?: LogLevel[];
|
47 | private static isBufferAttached;
|
48 | protected localInstanceRef?: LoggerService;
|
49 | private static WrapBuffer;
|
50 | constructor();
|
51 | constructor(context: string);
|
52 | constructor(context: string, options?: {
|
53 | timestamp?: boolean;
|
54 | });
|
55 | get localInstance(): LoggerService;
|
56 | /**
|
57 | * Write an 'error' level log.
|
58 | */
|
59 | error(message: any, stack?: string, context?: string): void;
|
60 | error(message: any, ...optionalParams: [...any, string?, string?]): void;
|
61 | /**
|
62 | * Write a 'log' level log.
|
63 | */
|
64 | log(message: any, context?: string): void;
|
65 | log(message: any, ...optionalParams: [...any, string?]): void;
|
66 | /**
|
67 | * Write a 'warn' level log.
|
68 | */
|
69 | warn(message: any, context?: string): void;
|
70 | warn(message: any, ...optionalParams: [...any, string?]): void;
|
71 | /**
|
72 | * Write a 'debug' level log.
|
73 | */
|
74 | debug(message: any, context?: string): void;
|
75 | debug(message: any, ...optionalParams: [...any, string?]): void;
|
76 | /**
|
77 | * Write a 'verbose' level log.
|
78 | */
|
79 | verbose(message: any, context?: string): void;
|
80 | verbose(message: any, ...optionalParams: [...any, string?]): void;
|
81 | /**
|
82 | * Write an 'error' level log.
|
83 | */
|
84 | static error(message: any, context?: string): void;
|
85 | static error(message: any, stack?: string, context?: string): void;
|
86 | static error(message: any, ...optionalParams: [...any, string?, string?]): void;
|
87 | /**
|
88 | * Write a 'log' level log.
|
89 | */
|
90 | static log(message: any, context?: string): void;
|
91 | static log(message: any, ...optionalParams: [...any, string?]): void;
|
92 | /**
|
93 | * Write a 'warn' level log.
|
94 | */
|
95 | static warn(message: any, context?: string): void;
|
96 | static warn(message: any, ...optionalParams: [...any, string?]): void;
|
97 | /**
|
98 | * Write a 'debug' level log, if the configured level allows for it.
|
99 | * Prints to `stdout` with newline.
|
100 | */
|
101 | static debug(message: any, context?: string): void;
|
102 | static debug(message: any, ...optionalParams: [...any, string?]): void;
|
103 | /**
|
104 | * Write a 'verbose' level log.
|
105 | */
|
106 | static verbose(message: any, context?: string): void;
|
107 | static verbose(message: any, ...optionalParams: [...any, string?]): void;
|
108 | /**
|
109 | * Print buffered logs and detach buffer.
|
110 | */
|
111 | static flush(): void;
|
112 | /**
|
113 | * Attach buffer.
|
114 | * Turns on initialisation logs buffering.
|
115 | */
|
116 | static attachBuffer(): void;
|
117 | /**
|
118 | * Detach buffer.
|
119 | * Turns off initialisation logs buffering.
|
120 | */
|
121 | static detachBuffer(): void;
|
122 | static getTimestamp(): string;
|
123 | static overrideLogger(logger: LoggerService | LogLevel[] | boolean): any;
|
124 | static isLevelEnabled(level: LogLevel): boolean;
|
125 | private registerLocalInstanceRef;
|
126 | }
|
127 | export {};
|