-
Notifications
You must be signed in to change notification settings - Fork 4
/
logger.go
84 lines (67 loc) · 1.77 KB
/
logger.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
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
package log
// PrintLogger represents a logger with Print* APIs.
type PrintLogger interface {
Print(...interface{})
Printf(string, ...interface{})
Println(...interface{})
PrintDepth(int, ...interface{})
PrintfDepth(int, string, ...interface{})
PrintlnDepth(int, ...interface{})
}
// DebugLogger represents a logger with Debug* APIs.
type DebugLogger interface {
Debug(...interface{})
Debugf(string, ...interface{})
DebugDepth(int, ...interface{})
DebugfDepth(int, string, ...interface{})
}
// InfoLogger represents a logger with Info* APIs.
type InfoLogger interface {
Info(...interface{})
Infof(string, ...interface{})
InfoDepth(int, ...interface{})
InfofDepth(int, string, ...interface{})
}
// WarnLogger represents a logger with Warn* APIs.
type WarnLogger interface {
Warn(...interface{})
Warnf(string, ...interface{})
WarnDepth(int, ...interface{})
WarnfDepth(int, string, ...interface{})
}
// ErrorLogger represents a logger with Error* APIs.
type ErrorLogger interface {
Error(...interface{})
Errorf(string, ...interface{})
ErrorDepth(int, ...interface{})
ErrorfDepth(int, string, ...interface{})
}
// FatalLogger represents a logger with Fatal* APIs.
type FatalLogger interface {
Fatal(...interface{})
Fatalf(string, ...interface{})
FatalDepth(int, ...interface{})
FatalfDepth(int, string, ...interface{})
}
// Leveler contains level-related APIs.
type Leveler interface {
DefaultLevel() Level
SetDefaultLevel(Level)
OutputLevel() Level
SetOutputLevel(Level)
}
// CallerOffsetter provides the ability of setting caller offset.
type CallerOffsetter interface {
SetCallerOffset(int)
}
// Logger represents a full-featured logger.
type Logger interface {
DebugLogger
PrintLogger
InfoLogger
WarnLogger
ErrorLogger
FatalLogger
Leveler
CallerOffsetter
}