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

Method Msgf

event.go:136–141  ·  view source on GitHub ↗

Msgf sends the event with formatted msg added as the message field if not empty. NOTICE: once this method is called, the *Event should be disposed. Calling Msgf twice can have unexpected result.

(format string, v ...interface{})

Source from the content-addressed store, hash-verified

134// NOTICE: once this method is called, the *Event should be disposed.
135// Calling Msgf twice can have unexpected result.
136func (e *Event) Msgf(format string, v ...interface{}) {
137 if e == nil {
138 return
139 }
140 e.msg(fmt.Sprintf(format, v...))
141}
142
143func (e *Event) MsgFunc(createMsg func() string) {
144 if e == nil {

Callers 5

TestEvent_WithNilEventFunction · 0.95
TestMsgfFunction · 0.80
TestDiscardFunction · 0.80
ExampleFatalFunction · 0.80
PrintfFunction · 0.80

Calls 1

msgMethod · 0.95

Tested by 4

TestEvent_WithNilEventFunction · 0.76
TestMsgfFunction · 0.64
TestDiscardFunction · 0.64
ExampleFatalFunction · 0.64