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

Method Stringers

event.go:357–363  ·  view source on GitHub ↗

Stringers adds the field key with vals to the *Event context. If a val is not nil, it is added by calling val.String(). If a val is nil, it is encoded as null without calling String(). This is the array version that accepts a slice of fmt.Stringer values.

(key string, vals []fmt.Stringer)

Source from the content-addressed store, hash-verified

355//
356// This is the array version that accepts a slice of fmt.Stringer values.
357func (e *Event) Stringers(key string, vals []fmt.Stringer) *Event {
358 if e == nil {
359 return e
360 }
361 e.buf = enc.AppendStringers(enc.AppendKey(e.buf, key), vals)
362 return e
363}
364
365// StringersV adds the field key with vals to the *Event context.
366// If a val is not nil, it is added by calling val.String().

Callers 11

StringersVMethod · 0.95
TestEvent_WithNilEventFunction · 0.95
ExampleEvent_StringersFunction · 0.45
TestWithPluralsFunction · 0.45
TestFieldsArrayNilFunction · 0.45
TestFieldsArrayEmptyFunction · 0.45
TestFieldsDisabledFunction · 0.45
BenchmarkLogFieldTypeFunction · 0.45

Calls 2

AppendKeyMethod · 0.65
AppendStringersMethod · 0.45

Tested by 10

TestEvent_WithNilEventFunction · 0.76
ExampleEvent_StringersFunction · 0.36
TestWithPluralsFunction · 0.36
TestFieldsArrayNilFunction · 0.36
TestFieldsArrayEmptyFunction · 0.36
TestFieldsDisabledFunction · 0.36
BenchmarkLogFieldTypeFunction · 0.36