MCPcopy
hub / github.com/sirupsen/logrus / WithError

Function WithError

exported.go:55–57  ·  view source on GitHub ↗

WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key.

(err error)

Source from the content-addressed store, hash-verified

53
54// WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key.
55func WithError(err error) *Entry {
56 return std.WithField(ErrorKey, err)
57}
58
59// WithContext creates an entry from the standard logger and adds a context to it.
60func WithContext(ctx context.Context) *Entry {

Callers 1

TestEntryWithErrorFunction · 0.85

Calls 1

WithFieldMethod · 0.65

Tested by 1

TestEntryWithErrorFunction · 0.68