-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathindex.d.ts
86 lines (78 loc) · 2.19 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import bunyan = require("bunyan");
import { Application } from "express";
import { Options as MorganOptions } from "morgan";
import http = require("http");
interface ILogFieldOptions {
application_type?: string;
log_type?: string;
service?: string;
}
declare namespace ServiceLogger {
export interface ILog4broOptions {
productionMode?: boolean;
logDir?: string;
silence?: boolean;
dockerMode?: boolean;
varKey?: string;
logFieldOptions?: ILogFieldOptions;
level?: string;
logLevel?: string;
serviceName?: string;
stackdriver?: { scope: string };
caller?: string;
loggerName?: string;
}
}
declare class ServiceLogger<
Request extends http.IncomingMessage,
Response extends http.ServerResponse
> {
productionMode: boolean;
varKey: string;
dockerMode: boolean;
logFieldOptions: ILogFieldOptions;
silence: boolean;
logDir: string;
logLevel: string;
serviceName: string;
stackdriver: { scope: string };
caller: string;
skipDebug: boolean;
LOG: bunyan;
errors: any[];
constructor(options: ServiceLogger.ILog4broOptions);
constructor(
loggerName: string,
silence: boolean,
logDir: string,
productionMode: boolean,
dockerMode: boolean,
varKey: string,
logFieldOptions: ILogFieldOptions,
level: string,
serviceName: string,
caller: string,
stackdriver: { scope: string }
);
createChild(defaultAdditionalFields?: any): ServiceLogger<Request, Response>;
changeLogLevel(level: string): void;
createLoggingDir(): void;
applyMiddlewareAccessLog(
expressApp: Application,
customTokens?: any,
accessLogOptions?: MorganOptions<Request, Response>
): Application;
applyMiddlewareAccessLogFile(
expressApp: Application,
logFilePath: string
): Application;
setGlobal(): void;
trace(message: string, additionalFields?: any): void;
debug(message: string, additionalFields?: any): void;
info(message: string, additionalFields?: any): void;
warn(message: string, additionalFields?: any): void;
error(message: string, additionalFields?: any): void;
fatal(message: string, additionalFields?: any): void;
raw(message: any, support?: boolean): void;
}
export = ServiceLogger;