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

Method Times

event.go:774–780  ·  view source on GitHub ↗

Times adds the field key with t formatted as string using zerolog.TimeFieldFormat.

(key string, t []time.Time)

Source from the content-addressed store, hash-verified

772
773// Times adds the field key with t formatted as string using zerolog.TimeFieldFormat.
774func (e *Event) Times(key string, t []time.Time) *Event {
775 if e == nil {
776 return e
777 }
778 e.buf = enc.AppendTimes(enc.AppendKey(e.buf, key), t, TimeFieldFormat)
779 return e
780}
781
782// Dur adds the field key with duration d stored as zerolog.DurationFieldUnit.
783// If zerolog.DurationFieldInteger is true, durations are rendered as integer

Callers 9

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

Calls 2

AppendTimesMethod · 0.65
AppendKeyMethod · 0.65

Tested by 9

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