-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.d.ts
49 lines (43 loc) · 1.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
export const EZLogs: (configs?: EZLogsConfig[]) => EZLogger
export interface EZLogger {
trace: (...args: any[]) => void
debug: (...args: any[]) => void
info: (...args: any[]) => void
log: (...args: any[]) => void
warn: (...args: any[]) => void
error: (...args: any[]) => void
fatal: (...args: any[]) => void
}
export enum LogLevel {
Trace = 'trace',
Debug = 'debug',
Info = 'info',
Warn = 'warn',
Error = 'error',
Fatal = 'fatal',
}
export interface ConfigConsole {
type: 'console'
sep?: string // default: '#'
level?: LogLevel
}
export interface ConfigFile {
type: 'file'
sep?: string // default: '#'
level?: LogLevel
pattern?: string // default ''
filename: string
path: string
}
export interface ConfigFileRoll {
type: 'file-date' | 'file-size' | 'file-number'
sep?: string // default: '#'
level?: LogLevel
pattern?: string // default ''
filename: string
path: string
max_backup: number
expire?: number // default is 3600 * 24(one day) for date
max_size?: number// default is 10000 for number, 1024kb for size
}
export type EZLogsConfig = ConfigFileRoll | ConfigConsole | ConfigFile