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

Method Float32

event.go:716–722  ·  view source on GitHub ↗

Float32 adds the field key with f as a float32 to the *Event context.

(key string, f float32)

Source from the content-addressed store, hash-verified

714
715// Float32 adds the field key with f as a float32 to the *Event context.
716func (e *Event) Float32(key string, f float32) *Event {
717 if e == nil {
718 return e
719 }
720 e.buf = enc.AppendFloat32(enc.AppendKey(e.buf, key), f, FloatingPointPrecision)
721 return e
722}
723
724// Floats32 adds the field key with f as a []float32 to the *Event context.
725func (e *Event) Floats32(key string, f []float32) *Event {

Callers 10

TestEvent_WithNilEventFunction · 0.95
TestWithFunction · 0.45
TestFieldsFunction · 0.45
TestFieldsDisabledFunction · 0.45
TestArrayFunction · 0.45
BenchmarkContextFieldsFunction · 0.45
BenchmarkLogFieldsFunction · 0.45
BenchmarkLogFieldTypeFunction · 0.45
generateFloat32sFunction · 0.45

Calls 2

AppendFloat32Method · 0.65
AppendKeyMethod · 0.65

Tested by 10

TestEvent_WithNilEventFunction · 0.76
TestWithFunction · 0.36
TestFieldsFunction · 0.36
TestFieldsDisabledFunction · 0.36
TestArrayFunction · 0.36
BenchmarkContextFieldsFunction · 0.36
BenchmarkLogFieldsFunction · 0.36
BenchmarkLogFieldTypeFunction · 0.36
generateFloat32sFunction · 0.36