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

Method MsgFunc

event.go:143–148  ·  view source on GitHub ↗
(createMsg func() string)

Source from the content-addressed store, hash-verified

141}
142
143func (e *Event) MsgFunc(createMsg func() string) {
144 if e == nil {
145 return
146 }
147 e.msg(createMsg())
148}
149
150func (e *Event) msg(msg string) {
151 for _, hook := range e.ch {

Callers 2

TestEvent_WithNilEventFunction · 0.95
TestEvent_MsgFuncFunction · 0.80

Calls 1

msgMethod · 0.95

Tested by 2

TestEvent_WithNilEventFunction · 0.76
TestEvent_MsgFuncFunction · 0.64