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

Method Floats64

event.go:743–749  ·  view source on GitHub ↗

Floats64 adds the field key with f as a []float64 to the *Event context.

(key string, f []float64)

Source from the content-addressed store, hash-verified

741
742// Floats64 adds the field key with f as a []float64 to the *Event context.
743func (e *Event) Floats64(key string, f []float64) *Event {
744 if e == nil {
745 return e
746 }
747 e.buf = enc.AppendFloats64(enc.AppendKey(e.buf, key), f, FloatingPointPrecision)
748 return e
749}
750
751// Timestamp adds the current local time as UNIX timestamp to the *Event context with the "time" key.
752// To customize the key name, change zerolog.TimestampFieldName.

Callers 8

TestEvent_WithNilEventFunction · 0.95
TestWithPluralsFunction · 0.45
TestFieldsArrayNilFunction · 0.45
TestFieldsArrayEmptyFunction · 0.45
BenchmarkLogFieldTypeFunction · 0.45

Calls 2

AppendFloats64Method · 0.65
AppendKeyMethod · 0.65

Tested by 8

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