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

Method EmbedObject

context.go:102–108  ·  view source on GitHub ↗

EmbedObject marshals and Embeds an object that implement the LogObjectMarshaler interface.

(obj LogObjectMarshaler)

Source from the content-addressed store, hash-verified

100
101// EmbedObject marshals and Embeds an object that implement the LogObjectMarshaler interface.
102func (c Context) EmbedObject(obj LogObjectMarshaler) Context {
103 e := c.l.scratchEvent()
104 e.EmbedObject(obj)
105 c.l.context = enc.AppendObjectData(c.l.context, e.buf)
106 putEvent(e)
107 return c
108}
109
110// Str adds the field key with val as a string to the logger context.
111func (c Context) Str(key, val string) Context {

Callers

nothing calls this directly

Calls 3

putEventFunction · 0.85
scratchEventMethod · 0.80
AppendObjectDataMethod · 0.65

Tested by

no test coverage detected