/
noop.go
37 lines (32 loc) · 1.63 KB
/
noop.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
package log
import "net/http"
type noopLogger struct {
loglevel string
}
var _ Logger = (*noopLogger)(nil)
func NewNoopLogger() Logger {
return &noopLogger{}
}
func (l *noopLogger) GetLogLevel() string { return l.loglevel }
func (l *noopLogger) SetLogLevel(level string) { l.loglevel = level }
func (l *noopLogger) Debug(args ...interface{}) {}
func (l *noopLogger) Debugf(format string, args ...interface{}) {}
func (l *noopLogger) Info(args ...interface{}) {}
func (l *noopLogger) Infof(format string, args ...interface{}) {}
func (l *noopLogger) Warn(args ...interface{}) {}
func (l *noopLogger) Warnf(format string, args ...interface{}) {}
func (l *noopLogger) Error(args ...interface{}) {}
func (l *noopLogger) Errorf(format string, args ...interface{}) {}
func (l *noopLogger) Fatal(args ...interface{}) {}
func (l *noopLogger) Fatalf(format string, args ...interface{}) {}
func (l *noopLogger) Panic(args ...interface{}) {}
func (l *noopLogger) Panicf(format string, args ...interface{}) {}
func (l *noopLogger) Print(args ...interface{}) {}
func (l *noopLogger) Println(args ...interface{}) {}
func (l *noopLogger) Printf(format string, args ...interface{}) {}
func (l *noopLogger) With(args ...interface{}) Logger { return l }
func (l *noopLogger) Named(name string) Logger { return l }
func (l *noopLogger) Flush() {}
func (l *noopLogger) LevelHandler(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
}