-
Notifications
You must be signed in to change notification settings - Fork 1
/
logger.go
35 lines (29 loc) · 933 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
package main
import "log"
type logger interface {
Criticalf(format string, args ...interface{})
Debugf(format string, args ...interface{})
Errorf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warningf(format string, args ...interface{})
}
type stdLogger struct{}
func newStdLogger() *stdLogger {
return &stdLogger{}
}
func (l *stdLogger) Criticalf(format string, args ...interface{}) {
log.Printf("CRITICAL: "+format, args...)
}
func (l *stdLogger) Debugf(format string, args ...interface{}) {
log.Printf("DEBUG: "+format, args...)
}
func (l *stdLogger) Errorf(format string, args ...interface{}) {
log.Printf("ERROR: "+format, args...)
}
func (l *stdLogger) Infof(format string, args ...interface{}) {
log.Printf("INFO: "+format, args...)
}
func (l *stdLogger) Warningf(format string, args ...interface{}) {
log.Printf("WARNING: "+format, args...)
}
var _ logger = (*stdLogger)(nil)