-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlog.go
41 lines (34 loc) · 952 Bytes
/
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
package gdcache
import (
"fmt"
)
// Logger Log component
type Logger interface {
// Info Info category log
Info(format string, a ...interface{})
// Error Error category log
Error(format string, a ...interface{})
// Debug Debug category log
Debug(format string, a ...interface{})
// Warn Warn category log
Warn(format string, a ...interface{})
}
// DefaultLogger Default log component
type DefaultLogger struct {
}
// Info Info category log
func (d DefaultLogger) Info(format string, a ...interface{}) {
fmt.Print(fmt.Sprintf(format, a...))
}
// Error Error category log
func (d DefaultLogger) Error(format string, a ...interface{}) {
fmt.Print(fmt.Sprintf(format, a...))
}
// Debug Debug category log
func (d DefaultLogger) Debug(format string, a ...interface{}) {
fmt.Print(fmt.Sprintf(format, a...))
}
// Warn Warn category log
func (d DefaultLogger) Warn(format string, a ...interface{}) {
fmt.Print(fmt.Sprintf(format, a...))
}