-
Notifications
You must be signed in to change notification settings - Fork 8
/
inst.go
113 lines (89 loc) · 1.77 KB
/
inst.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package logs
import (
"context"
"io"
"os"
)
var log = New(os.Stdout)
func SetLevel(lv logLevel) {
log.SetLevel(lv)
}
func SetSep(sep string) {
log.SetSep(sep)
}
func SetCaller(b bool) {
log.SetCaller(b)
}
func SetSkip(skip int) {
log.SetSkip(skip)
}
func SetOutput(out io.Writer) {
log.SetOutput(out)
}
func SetJSON() {
log.SetJSON()
}
func SetText() {
log.SetText()
}
func Debug(args ...any) {
if LDEBUG >= log.level {
print("", LDEBUG, log.caller, log, nil, args...)
}
}
func Debugf(foramt string, args ...any) {
if LDEBUG >= log.level {
printf("", LDEBUG, log.caller, log, nil, foramt, args...)
}
}
func Info(args ...any) {
if LINFO >= log.level {
print("", LINFO, log.caller, log, nil, args...)
}
}
func Infof(foramt string, args ...any) {
if LINFO >= log.level {
printf("", LINFO, log.caller, log, nil, foramt, args...)
}
}
func Warn(args ...any) {
if LWARN >= log.level {
print("", LWARN, log.caller, log, nil, args...)
}
}
func Warnf(foramt string, args ...any) {
if LWARN >= log.level {
printf("", LWARN, log.caller, log, nil, foramt, args...)
}
}
func Error(args ...any) {
if LERROR >= log.level {
print("", LERROR, log.caller, log, nil, args...)
}
}
func Errorf(foramt string, args ...any) {
if LERROR >= log.level {
printf("", LERROR, log.caller, log, nil, foramt, args...)
}
}
func With() *FieldLogger {
return log.With()
}
func Ctx(ctx context.Context) *FieldLogger {
return log.Ctx(ctx)
}
func Close() error {
return log.Close()
}
func SetFile(path string) {
log.SetFile(path)
}
func SetMaxAge(ma int) {
log.SetMaxAge(ma)
}
func SetMaxSize(ms int64) {
log.SetMaxSize(ms)
}
func SetCons(b bool) {
log.SetCons(b)
}