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

Method WithContext

entry.go:114–120  ·  view source on GitHub ↗

WithContext adds a context to the Entry.

(ctx context.Context)

Source from the content-addressed store, hash-verified

112
113// WithContext adds a context to the Entry.
114func (entry *Entry) WithContext(ctx context.Context) *Entry {
115 dataCopy := make(Fields, len(entry.Data))
116 for k, v := range entry.Data {
117 dataCopy[k] = v
118 }
119 return &Entry{Logger: entry.Logger, Data: dataCopy, Time: entry.Time, err: entry.err, Context: ctx}
120}
121
122// WithField adds a single field to the Entry.
123func (entry *Entry) WithField(key string, value interface{}) *Entry {

Callers 3

TestEntryWithContextFunction · 0.95
WithContextFunction · 0.45

Calls

no outgoing calls

Tested by 2

TestEntryWithContextFunction · 0.76