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

Method WithFields

logger.go:123–127  ·  view source on GitHub ↗

WithFields adds a struct of fields to the log entry. It calls [Entry.WithField] for each Field.

(fields Fields)

Source from the content-addressed store, hash-verified

121// WithFields adds a struct of fields to the log entry. It calls [Entry.WithField]
122// for each Field.
123func (logger *Logger) WithFields(fields Fields) *Entry {
124 entry := logger.newEntry()
125 defer logger.releaseEntry(entry)
126 return entry.WithFields(fields)
127}
128
129// WithError adds an error as single field to the log entry. It calls
130// [Entry.WithError] for the given error.

Callers 2

doLoggerBenchmarkFunction · 0.95
doLoggerBenchmarkNoLockFunction · 0.95

Calls 3

newEntryMethod · 0.95
releaseEntryMethod · 0.95
WithFieldsMethod · 0.65

Tested by 2

doLoggerBenchmarkFunction · 0.76
doLoggerBenchmarkNoLockFunction · 0.76