Skip to content

Commit

Permalink
log: extend Logger interface with WithValue method
Browse files Browse the repository at this point in the history
  • Loading branch information
Choraden committed Aug 28, 2023
1 parent f1b7666 commit 6e22e71
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type Logger interface {
Errorf(format string, args ...interface{})
Infof(format string, args ...interface{})
Debugf(format string, args ...interface{})
WithValue(key, value string) Logger
}

// NopLogger is a logger that does nothing.
Expand All @@ -26,3 +27,7 @@ func (l nopLogger) Infof(_ string, _ ...interface{}) {

func (l nopLogger) Debugf(_ string, _ ...interface{}) {
}

func (l nopLogger) WithValue(_, _ string) Logger {
return l
}

0 comments on commit 6e22e71

Please sign in to comment.