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

Method EmbedObject

event.go:303–312  ·  view source on GitHub ↗

EmbedObject marshals an object that implement the LogObjectMarshaler interface.

(obj LogObjectMarshaler)

Source from the content-addressed store, hash-verified

301
302// EmbedObject marshals an object that implement the LogObjectMarshaler interface.
303func (e *Event) EmbedObject(obj LogObjectMarshaler) *Event {
304 if e == nil {
305 return e
306 }
307 if obj == nil {
308 return e
309 }
310 obj.MarshalZerologObject(e)
311 return e
312}
313
314// Str adds the field key with val as a string to the *Event context.
315func (e *Event) Str(key, val string) *Event {

Callers 6

TestEvent_WithNilEventFunction · 0.95
ExampleEvent_EmbedObjectFunction · 0.45
ExampleEvent_EmbedObjectFunction · 0.45
TestEvent_ObjectFunction · 0.45

Calls 1

MarshalZerologObjectMethod · 0.65

Tested by 6

TestEvent_WithNilEventFunction · 0.76
ExampleEvent_EmbedObjectFunction · 0.36
ExampleEvent_EmbedObjectFunction · 0.36
TestEvent_ObjectFunction · 0.36