forked from zentures/surgemq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger.go
50 lines (38 loc) · 966 Bytes
/
logger.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
package glog
import (
"io"
"log"
"os"
)
type DefaultLogger struct {
*log.Logger
}
func newDefaultLogger(out io.Writer, prefix string, flag int) *DefaultLogger {
s := &DefaultLogger{}
s.Logger = log.New(os.Stderr, "", log.LstdFlags)
return s
}
func (this *DefaultLogger) Error(args ...interface{}) {
this.Print(args)
}
func (this *DefaultLogger) Errorf(format string, args ...interface{}) {
this.Printf(format, args)
}
func (this *DefaultLogger) Warn(args ...interface{}) {
this.Print(args)
}
func (this *DefaultLogger) Warnf(format string, args ...interface{}) {
this.Printf(format, args)
}
func (this *DefaultLogger) Info(args ...interface{}) {
this.Print(args)
}
func (this *DefaultLogger) Infof(format string, args ...interface{}) {
this.Printf(format, args)
}
func (this *DefaultLogger) Debug(args ...interface{}) {
this.Print(args)
}
func (this *DefaultLogger) Debugf(format string, args ...interface{}) {
this.Printf(format, args)
}