-
Notifications
You must be signed in to change notification settings - Fork 6
/
logger.go
40 lines (32 loc) · 1.03 KB
/
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
package openzwave
import "log"
// A logger interface. Modelled on github.com/juju/loggo so that can be used substituted by default.
type Logger interface {
// Log an info message.
Infof(message string, args ...interface{})
// Log a warning message.
Warningf(message string, args ...interface{})
// Log an error message.
Errorf(message string, args ...interface{})
// Log a debug message.
Debugf(message string, args ...interface{})
// Log a trace message.
Tracef(message string, args ...interface{})
}
type defaultLogger struct {
}
func (*defaultLogger) Infof(message string, args ...interface{}) {
log.Printf(message, args...)
}
func (*defaultLogger) Warningf(message string, args ...interface{}) {
log.Printf(message, args...)
}
func (*defaultLogger) Errorf(message string, args ...interface{}) {
log.Printf(message, args...)
}
func (*defaultLogger) Debugf(message string, args ...interface{}) {
log.Printf(message, args...)
}
func (*defaultLogger) Tracef(message string, args ...interface{}) {
log.Printf(message, args...)
}