-
Notifications
You must be signed in to change notification settings - Fork 3
/
logger.go
55 lines (44 loc) · 1.11 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package slaxy
// Logger defines simple methods for info and debugging messages
// that could be of interest for the outside
type Logger interface {
Debug(string)
Debugf(string, ...interface{})
Info(string)
Infof(string, ...interface{})
Warn(string)
Warnf(string, ...interface{})
Error(string)
Errorf(string, ...interface{})
}
// nullLogger is a logger that does nothing
type nullLogger struct {
}
// NewNullLogger returns a new instance of a logger that does nothing
func NewNullLogger() Logger {
return nullLogger{}
}
// Debug logs debug messages
func (l nullLogger) Debug(string) {
}
// Debugf logs debug messages
func (l nullLogger) Debugf(string, ...interface{}) {
}
// Info logs info messages
func (l nullLogger) Info(string) {
}
// Infof logs info messages
func (l nullLogger) Infof(string, ...interface{}) {
}
// Warn logs info messages
func (l nullLogger) Warn(string) {
}
// Warnf logs info messages
func (l nullLogger) Warnf(string, ...interface{}) {
}
// Error logs info messages
func (l nullLogger) Error(string) {
}
// Errorf logs info messages
func (l nullLogger) Errorf(string, ...interface{}) {
}