Skip to content

Commit

Permalink
slog: fix Logger.Error doc
Browse files Browse the repository at this point in the history
The error Attr now comes first, not last.

Change-Id: I595cb69c15ee07fa345cc2efae7e108bce606943
Reviewed-on: https://go-review.googlesource.com/c/exp/+/467439
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
  • Loading branch information
jba committed Feb 12, 2023
1 parent 01b2a36 commit a684f29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slog/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ func (l *Logger) Warn(msg string, args ...any) {
}

// Error logs at LevelError.
// If err is non-nil, Error appends Any(ErrorKey, err)
// to the list of attributes.
// If err is non-nil, Error adds Any(ErrorKey, err)
// before the list of attributes.
func (l *Logger) Error(msg string, err error, args ...any) {
l.logDepthErr(err, 1, LevelError, msg, args...)
}
Expand Down

0 comments on commit a684f29

Please sign in to comment.