Documentation
¶
Overview ¶
Package faillog logs a repeating background failure (a heartbeat or sync loop that cannot reach the database) without flooding the log: the first failure is logged at WARN, later ones are summarised at most once per interval, and the recovery is logged once at INFO.
Index ¶
Constants ¶
View Source
const DefaultEvery = time.Minute
DefaultEvery is how often a continuing failure is summarised.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tracker ¶
type Tracker struct {
// Every is the summary interval (DefaultEvery); Now the clock. Both
// may be changed before first use (tests).
Every time.Duration
Now func() time.Time
// contains filtered or unexported fields
}
Tracker follows one repeating operation. The zero value is not usable; call New. Methods are safe for concurrent use and a nil *Tracker ignores every call.
func (*Tracker) Fail ¶
Fail records a failed attempt: the first of an outage is logged at WARN, later ones are summarised at most once per Every.
Click to show internal directories.
Click to hide internal directories.