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

Method Type

event.go:837–843  ·  view source on GitHub ↗

Type adds the field key with val's type using reflection.

(key string, val interface{})

Source from the content-addressed store, hash-verified

835
836// Type adds the field key with val's type using reflection.
837func (e *Event) Type(key string, val interface{}) *Event {
838 if e == nil {
839 return e
840 }
841 e.buf = enc.AppendType(enc.AppendKey(e.buf, key), val)
842 return e
843}
844
845// CallerSkipFrame instructs any future Caller calls to skip the specified number of frames.
846// This includes those added via hooks from the context.

Callers 8

TestEvent_WithNilEventFunction · 0.95
TestWithFunction · 0.45
TestFieldsFunction · 0.45
TestArrayFunction · 0.45
BenchmarkLogFieldTypeFunction · 0.45
getEventFunction · 0.45

Calls 2

AppendKeyMethod · 0.65
AppendTypeMethod · 0.45

Tested by 6

TestEvent_WithNilEventFunction · 0.76
TestWithFunction · 0.36
TestFieldsFunction · 0.36
TestArrayFunction · 0.36
BenchmarkLogFieldTypeFunction · 0.36