Documentation
¶
Overview ¶
Package duration provides options for time.Duration field rendering in clog.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Duration ¶ added in v0.11.19
type Duration = core.DurationField
Duration is the value type for duration fields.
type Option ¶ added in v0.11.19
type Option func(*Duration)
Option configures how a duration field is rendered.
func WithGradient ¶ added in v0.11.19
WithGradient returns an Option that overrides the logger's duration gradient color stops for this field.
func WithGradientMax ¶ added in v0.11.19
WithGradientMax returns an Option that overrides the logger's duration gradient maximum for this field. The gradient runs from the first stop at 0 to the last stop at max.
clog.Info().Duration("latency", d, duration.WithGradientMax(3*time.Second))
func WithGradientMode ¶ added in v0.11.19
func WithGradientMode(mode style.GradientMode) Option
WithGradientMode returns an Option that overrides the logger's duration gradient transition mode (style.GradientFade or style.GradientStep) for this field.
Click to show internal directories.
Click to hide internal directories.