-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.go
58 lines (51 loc) · 1.29 KB
/
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
package fancylog
type FancyLogger interface {
StandardLog
FormatLog
MappedLog
PrefixLog
WithColor() FancyLogger
WithoutColor() FancyLogger
WithDebug() FancyLogger
WithoutDebug() FancyLogger
WithTrace() FancyLogger
WithoutTrace() FancyLogger
IsDebug() bool
IsTrace() bool
WithTimestamp() FancyLogger
WithoutTimestamp() FancyLogger
Quiet() FancyLogger
NoQuiet() FancyLogger
IsQuiet() bool
output(prefix Prefix, data string, isErr bool, prefixColorOverride *Color)
outputMap(prefix Prefix, data map[string]interface{}, isErr bool, prefixColorOverride *Color, mapKeyColorOverride *map[string]Color)
}
type StandardLog interface {
Info(a ...any)
Debug(a ...any)
Warn(a ...any)
Error(a ...any)
Trace(a ...any)
Fatal(a ...any)
}
type FormatLog interface {
Infof(format string, a ...any)
Debugf(format string, a ...any)
Warnf(format string, a ...any)
Errorf(format string, a ...any)
Tracef(format string, a ...any)
Fatalf(format string, a ...any)
}
type MappedLog interface {
InfoMap(a map[string]any)
DebugMap(a map[string]any)
WarnMap(a map[string]any)
ErrorMap(a map[string]any)
TraceMap(a map[string]any)
FatalMap(a map[string]any)
}
type PrefixLog interface {
Log(prefix Prefix, a ...any)
Logf(prefix Prefix, format string, a ...any)
LogMap(prefix Prefix, a map[string]any)
}