Durs adds the field key with duration d stored as zerolog.DurationFieldUnit. If zerolog.DurationFieldInteger is true, durations are rendered as integer instead of float.
(key string, d []time.Duration)
| 794 | // If zerolog.DurationFieldInteger is true, durations are rendered as integer |
| 795 | // instead of float. |
| 796 | func (e *Event) Durs(key string, d []time.Duration) *Event { |
| 797 | if e == nil { |
| 798 | return e |
| 799 | } |
| 800 | e.buf = enc.AppendDurations(enc.AppendKey(e.buf, key), d, DurationFieldUnit, DurationFieldFormat, DurationFieldInteger, FloatingPointPrecision) |
| 801 | return e |
| 802 | } |
| 803 | |
| 804 | // TimeDiff adds the field key with positive duration between time t and start. |
| 805 | // If time t is not greater than start, duration will be 0. |