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

Method Func

event.go:295–300  ·  view source on GitHub ↗

Func allows an anonymous func to run only if the event is enabled.

(f func(e *Event))

Source from the content-addressed store, hash-verified

293
294// Func allows an anonymous func to run only if the event is enabled.
295func (e *Event) Func(f func(e *Event)) *Event {
296 if e != nil && e.Enabled() {
297 f(e)
298 }
299 return e
300}
301
302// EmbedObject marshals an object that implement the LogObjectMarshaler interface.
303func (e *Event) EmbedObject(obj LogObjectMarshaler) *Event {

Callers 2

TestFieldsFunction · 0.80
TestFieldsDisabledFunction · 0.80

Calls 1

EnabledMethod · 0.95

Tested by 2

TestFieldsFunction · 0.64
TestFieldsDisabledFunction · 0.64