-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.go
81 lines (65 loc) · 2.02 KB
/
default.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
package log
import (
"fmt"
"io"
)
//SetLevel set defalut log level
func SetLevel(level Level) {
_log.SetLevel(level)
}
// SetFlags sets the out put flag
func SetFlags(flag int) {
_log.SetFlags(flag)
}
// SetOutput sets the output destination
func SetOutput(w io.Writer) {
_log.SetOutput(w)
}
// Error output with ERROR level
func Error(v ...interface{}) {
_log.log(3, ERROR, fmt.Sprint(v...))
}
// DepthError set the call depth and output with ERROR level
func DepthError(calldepth int, v ...interface{}) {
_log.log(calldepth, ERROR, fmt.Sprint(v...))
}
// Errorf output with ERROR level, Arguments are handled in the manner of fmt.Sprintf
func Errorf(format string, v ...interface{}) {
_log.log(3, ERROR, fmt.Sprintf(format, v...))
}
// Warn output with WARN level
func Warn(v ...interface{}) {
_log.log(3, WARN, fmt.Sprint(v...))
}
// DepthWarn set the call depth and output with WARN level
func DepthWarn(calldepth int, v ...interface{}) {
_log.log(calldepth, WARN, fmt.Sprint(v...))
}
// Warnf output with WARN level, Arguments are handled in the manner of fmt.Sprintf
func Warnf(format string, v ...interface{}) {
_log.log(3, WARN, fmt.Sprintf(format, v...))
}
// Info output with INFO level
func Info(v ...interface{}) {
_log.log(3, INFO, fmt.Sprint(v...))
}
// DepthInfo set the call depth and output with INFO level
func DepthInfo(calldepth int, v ...interface{}) {
_log.log(calldepth, INFO, fmt.Sprint(v...))
}
// Infof output with INFO level, Arguments are handled in the manner of fmt.Sprintf
func Infof(format string, v ...interface{}) {
_log.log(3, INFO, fmt.Sprintf(format, v...))
}
// Debug output with DEBUG level
func Debug(v ...interface{}) {
_log.log(3, DEBUG, fmt.Sprint(v...))
}
// DepthDebug set the call depth and output with DEBUG level
func DepthDebug(calldepth int, v ...interface{}) {
_log.log(calldepth, DEBUG, fmt.Sprint(v...))
}
// Debugf output with DEBUG level, Arguments are handled in the manner of fmt.Sprintf
func Debugf(format string, v ...interface{}) {
_log.log(3, DEBUG, fmt.Sprintf(format, v...))
}