1 | import * as logform from "logform";
|
2 | import * as Transport from "winston-transport";
|
3 | import { Configuration } from "../configuration";
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export declare const logger: Logger;
|
10 |
|
11 |
|
12 |
|
13 | export declare enum LoggingFormat {
|
14 | |
15 |
|
16 |
|
17 | None = 0,
|
18 | |
19 |
|
20 |
|
21 | Simple = 1,
|
22 | |
23 |
|
24 |
|
25 | Full = 2
|
26 | }
|
27 |
|
28 |
|
29 |
|
30 | export interface LoggingConfiguration {
|
31 | console: {
|
32 | |
33 |
|
34 |
|
35 | enabled: boolean;
|
36 | |
37 |
|
38 |
|
39 | level?: string;
|
40 | |
41 |
|
42 |
|
43 | format?: LoggingFormat;
|
44 | |
45 |
|
46 |
|
47 | redirect?: boolean;
|
48 | };
|
49 | file: {
|
50 | |
51 |
|
52 |
|
53 | enabled: boolean;
|
54 | |
55 |
|
56 |
|
57 | level?: string;
|
58 | |
59 |
|
60 |
|
61 | filename?: string;
|
62 | |
63 |
|
64 |
|
65 | format?: LoggingFormat;
|
66 | };
|
67 | custom?: Transport[];
|
68 | redact?: boolean;
|
69 | callsites?: boolean;
|
70 | color?: boolean;
|
71 | }
|
72 |
|
73 |
|
74 |
|
75 | export declare const NoLogging: LoggingConfiguration;
|
76 |
|
77 |
|
78 |
|
79 | export declare const PlainLogging: LoggingConfiguration;
|
80 |
|
81 |
|
82 |
|
83 | export declare const MinimalLogging: LoggingConfiguration;
|
84 |
|
85 |
|
86 |
|
87 | export declare const ClientLogging: LoggingConfiguration;
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 | export declare function configureLogging(config: LoggingConfiguration): void;
|
94 |
|
95 |
|
96 |
|
97 |
|
98 | export declare function clientLoggingConfiguration(configuration: Configuration): LoggingConfiguration;
|
99 | export declare function callsite(logInfo: logform.TransformableInfo): logform.TransformableInfo;
|
100 | export interface Logger {
|
101 | log: LogMethod;
|
102 | error: LeveledLogMethod;
|
103 | warn: LeveledLogMethod;
|
104 | info: LeveledLogMethod;
|
105 | debug: LeveledLogMethod;
|
106 | verbose: LeveledLogMethod;
|
107 | }
|
108 | export interface LogMethod {
|
109 | (level: string, msg: string, callback: LogCallback): Logger;
|
110 | (level: string, msg: string, meta: any, callback: LogCallback): Logger;
|
111 | (level: string, msg: string, ...meta: any[]): Logger;
|
112 | }
|
113 | export interface LeveledLogMethod {
|
114 | (msg: string, callback: LogCallback): Logger;
|
115 | (msg: string, meta: any, callback: LogCallback): Logger;
|
116 | (msg: string, ...meta: any[]): Logger;
|
117 | }
|
118 | export declare type LogCallback = (error?: any, level?: string, msg?: string, meta?: any) => void;
|
119 |
|
\ | No newline at end of file |