changes per @ethanfrey comments

This commit is contained in:
Anton Kaliaev
2017-05-04 19:39:16 +04:00
parent b2bd039923
commit ea01d003d1
6 changed files with 57 additions and 39 deletions

View File

@ -2,6 +2,9 @@ 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{} }
@ -16,3 +19,11 @@ func (nopLogger) Debug(string, ...interface{}) error {
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
}