Skip to content

Commit

Permalink
Add explanatory comment for zap.Err shortcut (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayjshah committed Jun 3, 2016
1 parent cf62a04 commit 6f80dbd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion field.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ func Time(key string, val time.Time) Field {
return Int64(key, val.UnixNano())
}

// Err constructs a Field that stores err.Error() under the key "error".
// Err constructs a Field that stores err.Error() under the key "error". This is
// just a convenient shortcut for a common pattern - apart from saving a few
// keystrokes, it's no different from using zap.String.
func Err(err error) Field {
return String("error", err.Error())
}
Expand Down

0 comments on commit 6f80dbd

Please sign in to comment.