Documentation
¶
Overview ¶
Package selflog is agnt's always-on persistent log for its OWN fire-and-forget failures — the errors that, by design, must stay silent to their caller and so would otherwise vanish.
Unlike internal/debug (which only writes when debug mode is enabled), selflog always writes, to a single rotating file at ${XDG_CACHE_HOME:-$HOME/.cache}/agnt/errors.log. The two writers that matter most run when the daemon is unreachable — the `agnt hook` dispatcher (a separate short-lived process) and the incident pinger — so the log is file-based with no daemon dependency: the viewer command (`agnt hook log`) and the overlay status notice both read it directly, and it works even with the daemon down.
The package is a leaf (no agnt imports) so the latency-budgeted hook dispatcher and the import-cycle-sensitive overlay can both use it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountSince ¶
CountSince returns how many entries have a timestamp at or after t. Used by the overlay to decide whether to raise a status-bar notice. A missing file counts as zero.
func DefaultPath ¶
func DefaultPath() string
DefaultPath resolves the persistent error-log location. AGNT_ERROR_LOG wins (tests and power users redirect with one env var); otherwise it follows the XDG cache convention, matching internal/debug's log dir.