Skip to content

Commit

Permalink
Clarify description of With function (#1096)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwheeler authored Apr 25, 2023
1 parent a1f826a commit 5cf9af3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion log/with_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ type WithLogger interface {
With(keyvals ...interface{}) Logger
}

// With returns Logger instance that prepend every log entry with keyvals. If logger implements WithLogger it is used, otherwise every log call will be intercepted.
// With creates a child Logger that includes the supplied key-value pairs in each log entry. It does this by
// using the supplied logger if it implements WithLogger; otherwise, it does so by intercepting every log call.
func With(logger Logger, keyvals ...interface{}) Logger {
if wl, ok := logger.(WithLogger); ok {
return wl.With(keyvals...)
Expand Down

0 comments on commit 5cf9af3

Please sign in to comment.