Implement WithError(err) in exported, fixed doco.

This commit is contained in:
Joern Barthel
2015-05-19 19:50:55 +02:00
parent c24d0555d7
commit e3e5de11c4
3 changed files with 18 additions and 4 deletions
+5
View File
@@ -48,6 +48,11 @@ func AddHook(hook Hook) {
std.Hooks.Add(hook)
}
// WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key.
func WithError(err error) *Entry {
return std.WithField(ErrorKey, err)
}
// WithField creates an entry from the standard logger and adds a field to
// it. If you want multiple fields, use `WithFields`.
//