-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog.go
executable file
·76 lines (57 loc) · 1.3 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package rslog
import (
"github.com/refitor/rslog/sys"
)
var v_logger i_log = sys.New()
type i_log interface {
Info(datas ...interface{})
Infof(format string, datas ...interface{})
Debug(datas ...interface{})
Debugf(format string, datas ...interface{})
Warn(datas ...interface{})
Warnf(format string, datas ...interface{})
Error(datas ...interface{})
Errorf(format string, datas ...interface{})
SetLevel(l string)
SetDepth(depth int) int
ResetLog(l interface{})
}
func Info(datas ...interface{}) {
v_logger.Info(datas...)
}
func Infof(format string, datas ...interface{}) {
v_logger.Infof(format, datas...)
}
func Debug(datas ...interface{}) {
v_logger.Debug(datas...)
}
func Debugf(format string, datas ...interface{}) {
v_logger.Debugf(format, datas...)
}
func Warn(datas ...interface{}) {
v_logger.Warn(datas...)
}
func Warnf(format string, datas ...interface{}) {
v_logger.Warnf(format, datas...)
}
func Error(datas ...interface{}) {
v_logger.Error(datas...)
}
func Errorf(format string, datas ...interface{}) {
v_logger.Errorf(format, datas...)
}
func SetDepth(depth int) int {
return v_logger.SetDepth(depth)
}
func SetLevel(l string) {
v_logger.SetLevel(l)
}
func ResetLog(l interface{}) {
v_logger.ResetLog(l)
}
func UseLog(l i_log) {
if l == nil {
l = sys.New()
}
v_logger = l
}