-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplugin-log.go
74 lines (60 loc) · 1.74 KB
/
plugin-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
package goku_standard_plugin
import "fmt"
type PluginLogProxy struct {
pluginName string
}
func GenLogger(pluginName string)Logger {
return &PluginLogProxy{
pluginName:fmt.Sprintf("[plugin:%s]",pluginName),
}
}
func (l *PluginLogProxy) Debugf(format string, args ...interface{}) {
format = fmt.Sprintf("%s %s",l.pluginName,format)
Debugf(format,args...)
}
func (l *PluginLogProxy) Infof(format string, args ...interface{}) {
format = fmt.Sprintf("%s %s",l.pluginName,format)
Infof(format,args...)
}
func (l *PluginLogProxy) Warnf(format string, args ...interface{}) {
format = fmt.Sprintf("%s %s",l.pluginName,format)
Warnf(format,args...)
}
func (l *PluginLogProxy) Warningf(format string, args ...interface{}) {
format = fmt.Sprintf("%s %s",l.pluginName,format)
Warningf(format,args...)
}
func (l *PluginLogProxy) Errorf(format string, args ...interface{}) {
format = fmt.Sprintf("%s %s",l.pluginName,format)
Errorf(format,args...)
}
func (l *PluginLogProxy) Debug(args ...interface{}) {
vs:=make([]interface{},0,len(args)+1)
vs = append(vs,l.pluginName)
vs = append(vs,args...)
Debug(vs...)
}
func (l *PluginLogProxy) Info(args ...interface{}) {
vs:=make([]interface{},0,len(args)+1)
vs = append(vs,l.pluginName)
vs = append(vs,args...)
Info(vs...)
}
func (l *PluginLogProxy) Warn(args ...interface{}) {
vs:=make([]interface{},0,len(args)+1)
vs = append(vs,l.pluginName)
vs = append(vs,args...)
Warn(vs...)
}
func (l *PluginLogProxy) Warning(args ...interface{}) {
vs:=make([]interface{},0,len(args)+1)
vs = append(vs,l.pluginName)
vs = append(vs,args...)
Warning(vs...)
}
func (l *PluginLogProxy) Error(args ...interface{}) {
vs:=make([]interface{},0,len(args)+1)
vs = append(vs,l.pluginName)
vs = append(vs,args...)
Error(vs...)
}