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

Method WithError

entry.go:109–111  ·  view source on GitHub ↗

WithError adds an error as single field (using the key defined in [ErrorKey]) to the Entry.

(err error)

Source from the content-addressed store, hash-verified

107// WithError adds an error as single field (using the key defined in [ErrorKey])
108// to the Entry.
109func (entry *Entry) WithError(err error) *Entry {
110 return entry.WithField(ErrorKey, err)
111}
112
113// WithContext adds a context to the Entry.
114func (entry *Entry) WithContext(ctx context.Context) *Entry {

Callers 1

TestEntryWithErrorFunction · 0.95

Calls 1

WithFieldMethod · 0.95

Tested by 1

TestEntryWithErrorFunction · 0.76