-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.go
59 lines (45 loc) · 968 Bytes
/
log.go
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
package xlog
const (
ErrorLevel LogLevel = iota + 1
WarnLevel
InfoLevel
DebugLevel
)
const (
callDepth = 3
)
type LogLevel int
var (
debugLog XLogger = &DebugLogger{}
infoLog XLogger = &InfoLogger{}
warnLog XLogger = &WarnLogger{}
errLog XLogger = &ErrorLogger{}
Level LogLevel
)
type XLogger interface {
LogOut(col *ColorType, format *string, args ...any)
}
func Info(args ...any) {
infoLog.LogOut(nil, nil, args...)
}
func Infof(format string, args ...any) {
infoLog.LogOut(nil, &format, args...)
}
func Debug(args ...any) {
debugLog.LogOut(nil, nil, args...)
}
func Debugf(format string, args ...any) {
debugLog.LogOut(nil, &format, args...)
}
func Warn(args ...any) {
warnLog.LogOut(nil, nil, args...)
}
func Warnf(format string, args ...any) {
warnLog.LogOut(nil, &format, args...)
}
func Error(args ...any) {
errLog.LogOut(nil, nil, args...)
}
func Errorf(format string, args ...any) {
errLog.LogOut(nil, &format, args...)
}