-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.ts
96 lines (85 loc) · 1.35 KB
/
constants.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
87
88
89
90
91
92
93
94
95
96
import type { LogObject } from './types'
export type LogLevel = 0 | 1 | 2 | 3 | 4 | 5 | (number & {})
export const LogLevels: Record<LogType, number> = {
silent: Number.NEGATIVE_INFINITY,
fatal: 0,
error: 0,
warn: 1,
log: 2,
info: 3,
success: 3,
fail: 3,
ready: 3,
start: 3,
debug: 4,
trace: 5,
verbose: Number.POSITIVE_INFINITY,
}
export type LogType =
// 0
| 'silent'
| 'fatal'
| 'error'
// 1
| 'warn'
// 2
| 'log'
// 3
| 'info'
| 'success'
| 'fail'
| 'ready'
| 'start'
// Verbose
| 'debug'
| 'trace'
| 'verbose'
export const LogTypes: Record<LogType, Partial<LogObject>> = {
// Silent
silent: {
level: -1,
},
// Level 0
fatal: {
level: LogLevels.fatal,
},
error: {
level: LogLevels.error,
},
// Level 1
warn: {
level: LogLevels.warn,
},
// Level 2
log: {
level: LogLevels.log,
},
// Level 3
info: {
level: LogLevels.info,
},
success: {
level: LogLevels.success,
},
fail: {
level: LogLevels.fail,
},
ready: {
level: LogLevels.info,
},
start: {
level: LogLevels.info,
},
// Level 4
debug: {
level: LogLevels.debug,
},
// Level 5
trace: {
level: LogLevels.trace,
},
// Verbose
verbose: {
level: LogLevels.verbose,
},
}