MCPcopy
hub / github.com/rs/zerolog / Object

Method Object

context.go:73–79  ·  view source on GitHub ↗

Object marshals an object that implement the LogObjectMarshaler interface.

(key string, obj LogObjectMarshaler)

Source from the content-addressed store, hash-verified

71
72// Object marshals an object that implement the LogObjectMarshaler interface.
73func (c Context) Object(key string, obj LogObjectMarshaler) Context {
74 e := c.l.scratchEvent()
75 e.Object(key, obj)
76 c.l.context = enc.AppendObjectData(c.l.context, e.buf)
77 putEvent(e)
78 return c
79}
80
81// Objects adds the field key with objs to the logger context as an array of
82// objects that implement the LogObjectMarshaler interface.

Callers 3

AnErrMethod · 0.95
ErrMethod · 0.95
InterfaceMethod · 0.95

Calls 3

putEventFunction · 0.85
scratchEventMethod · 0.80
AppendObjectDataMethod · 0.65

Tested by

no test coverage detected