tendermint/log/nop_logger.go
2017-05-05 21:48:03 +04:00

30 lines
542 B
Go

package log
type nopLogger struct{}
// Interface assertions
var _ Logger = (*nopLogger)(nil)
// NewNopLogger returns a logger that doesn't do anything.
func NewNopLogger() Logger { return &nopLogger{} }
func (nopLogger) Info(string, ...interface{}) error {
return nil
}
func (nopLogger) Debug(string, ...interface{}) error {
return nil
}
func (nopLogger) Error(string, ...interface{}) error {
return nil
}
func (l *nopLogger) With(...interface{}) Logger {
return l
}
func (l *nopLogger) WithLevel(lvl string) Logger {
return l
}