-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.go
68 lines (52 loc) · 1.53 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
package glog
import (
"github.com/gw123/glog/common"
"github.com/gw123/glog/driver/zap_driver"
)
const (
DriverZap = "zap"
)
// 为了方便创建一个默认的Logger
func DefaultLogger() common.Logger {
return zap_driver.DefaultLogger()
}
// 为了方便创建一个默认的Logger
func Log() common.Logger {
return zap_driver.DefaultLogger()
}
func SetDefaultZapLoggerConfig(options common.Options, withFuncList ...common.WithFunc) error {
return zap_driver.SetDefaultLoggerConfig(options, withFuncList...)
}
func Error(format string) {
zap_driver.GetInnerLogger().Error(format)
}
func Errorf(format string, other ...interface{}) {
zap_driver.GetInnerLogger().Errorf(format, other...)
}
func Warn(format string) {
zap_driver.GetInnerLogger().Warn(format)
}
func Warnf(format string, other ...interface{}) {
zap_driver.GetInnerLogger().Warnf(format, other...)
}
func Info(format string) {
zap_driver.GetInnerLogger().Info(format)
}
func Infof(format string, other ...interface{}) {
zap_driver.GetInnerLogger().Infof(format, other...)
}
func Debug(format string) {
zap_driver.GetInnerLogger().Debug(format)
}
func Debugf(format string, other ...interface{}) {
zap_driver.GetInnerLogger().Debugf(format, other...)
}
func WithField(format string, other ...interface{}) common.Logger {
return zap_driver.GetInnerLogger().WithField(format, other)
}
func WithErr(err error) common.Logger {
return zap_driver.GetInnerLogger().WithError(err)
}
func WithError(err error) common.Logger {
return zap_driver.GetInnerLogger().WithError(err)
}