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

Method WithError

logger.go:131–135  ·  view source on GitHub ↗

WithError adds an error as single field to the log entry. It calls [Entry.WithError] for the given error.

(err error)

Source from the content-addressed store, hash-verified

129// WithError adds an error as single field to the log entry. It calls
130// [Entry.WithError] for the given error.
131func (logger *Logger) WithError(err error) *Entry {
132 entry := logger.newEntry()
133 defer logger.releaseEntry(entry)
134 return entry.WithError(err)
135}
136
137// WithContext add a context to the log entry.
138func (logger *Logger) WithContext(ctx context.Context) *Entry {

Callers

nothing calls this directly

Calls 3

newEntryMethod · 0.95
releaseEntryMethod · 0.95
WithErrorMethod · 0.65

Tested by

no test coverage detected