Dur 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)
| 783 | // If zerolog.DurationFieldInteger is true, durations are rendered as integer |
| 784 | // instead of float. |
| 785 | func (e *Event) Dur(key string, d time.Duration) *Event { |
| 786 | if e == nil { |
| 787 | return e |
| 788 | } |
| 789 | e.buf = enc.AppendDuration(enc.AppendKey(e.buf, key), d, DurationFieldUnit, DurationFieldFormat, DurationFieldInteger, FloatingPointPrecision) |
| 790 | return e |
| 791 | } |
| 792 | |
| 793 | // Durs adds the field key with duration d stored as zerolog.DurationFieldUnit. |
| 794 | // If zerolog.DurationFieldInteger is true, durations are rendered as integer |