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

Method Bool

event.go:518–524  ·  view source on GitHub ↗

Bool adds the field key with val as a bool to the *Event context.

(key string, b bool)

Source from the content-addressed store, hash-verified

516
517// Bool adds the field key with val as a bool to the *Event context.
518func (e *Event) Bool(key string, b bool) *Event {
519 if e == nil {
520 return e
521 }
522 e.buf = enc.AppendBool(enc.AppendKey(e.buf, key), b)
523 return e
524}
525
526// Bools adds the field key with val as a []bool to the *Event context.
527func (e *Event) Bools(key string, b []bool) *Event {

Callers 15

TestEvent_WithNilEventFunction · 0.95
TestWithFunction · 0.45
TestStackedWithsFunction · 0.45
TestFieldsFunction · 0.45
TestFieldsDisabledFunction · 0.45
hook_test.goFile · 0.45
TestArrayFunction · 0.45
TestEvent_ObjectFunction · 0.45
BenchmarkLogFieldTypeFunction · 0.45

Calls 2

AppendBoolMethod · 0.65
AppendKeyMethod · 0.65

Tested by 13

TestEvent_WithNilEventFunction · 0.76
TestWithFunction · 0.36
TestStackedWithsFunction · 0.36
TestFieldsFunction · 0.36
TestFieldsDisabledFunction · 0.36
TestArrayFunction · 0.36
TestEvent_ObjectFunction · 0.36
BenchmarkLogFieldTypeFunction · 0.36
ExampleFunction · 0.36