/
noop_logger.go
39 lines (30 loc) · 955 Bytes
/
noop_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
package logging
import "os"
//The NoopLogger is an empty implementation of Logger.
//This can be used to disable the logging
//capabilities of quacktors.
type NoopLogger struct {
}
//Init noop implementation
func (l *NoopLogger) Init() {
}
//Trace noop implementation
func (l *NoopLogger) Trace(message string, values ...interface{}) {
}
//Debug noop implementation
func (l *NoopLogger) Debug(message string, values ...interface{}) {
}
//Info noop implementation
func (l *NoopLogger) Info(message string, values ...interface{}) {
}
//Warn noop implementation
func (l *NoopLogger) Warn(message string, values ...interface{}) {
}
//Error noop implementation
func (l *NoopLogger) Error(message string, values ...interface{}) {
}
//Fatal does not print (as this is a noop implementation), but does
//exit the application with exit code 1, as this is a "Fatal" method.
func (l *NoopLogger) Fatal(message string, values ...interface{}) {
os.Exit(1)
}