Documentation
¶
Overview ¶
Package logedge gates repetitive condition logs: emit on the edge (first sight or signature change), optionally a sparse pulse while the condition holds, and once more when it clears.
Use it for periodic probes that fail the same way on every tick. Callers still own the slog line; this package only answers whether to print and with what counters. It is not a logger and not a retry scheduler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gate ¶
type Gate struct {
// Repeat is the minimum interval between Hold pulses. Zero disables them.
Repeat time.Duration
// contains filtered or unexported fields
}
Gate tracks per-key signatures. A zero Gate is ready to use (Repeat=0 means edge-only: Rise/Fall, never Hold).
type Result ¶
type Result struct {
Event Event
// Streak is consecutive Observe hits for the current signature
// (Fall: streak at the moment of Clear).
Streak int
Since time.Time
// Suppressed is how many Observe calls were skipped since the last
// emission (Hold/Fall). Zero on Rise.
Suppressed int
}
Result is the decision for one Observe or Clear call.