MCPcopy
hub / github.com/uber-go/zap / ContextMap

Method ContextMap

zaptest/observer/logged_entry.go:33–39  ·  view source on GitHub ↗

ContextMap returns a map for all fields in Context.

()

Source from the content-addressed store, hash-verified

31
32// ContextMap returns a map for all fields in Context.
33func (e LoggedEntry) ContextMap() map[string]interface{} {
34 encoder := zapcore.NewMapObjectEncoder()
35 for _, f := range e.Context {
36 f.AddTo(encoder)
37 }
38 return encoder.Fields
39}

Callers 5

TestEmptyAttrFunction · 0.80
TestInlineGroupFunction · 0.80
TestWithGroupFunction · 0.80
TestAttrKindsFunction · 0.80

Calls 2

NewMapObjectEncoderFunction · 0.92
AddToMethod · 0.80

Tested by 5

TestEmptyAttrFunction · 0.64
TestInlineGroupFunction · 0.64
TestWithGroupFunction · 0.64
TestAttrKindsFunction · 0.64