Documentation
¶
Overview ¶
Package logfile is the single, shared rotating-append writer for satelle's flat evidence logs under .satelle/logs (the operation log and the reviewer log). It bounds their growth — roll by UTC day and by max size, keep at most N rotated files — so a long-running repo does not accumulate an unbounded log (sty_a67e6e8c).
It is deliberately stateless and best-effort, matching how the evidence logs are written: each Append opens, rotates-if-needed, writes one line, and closes. A logging error never breaks the caller (the caller may ignore the returned error).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = Config{MaxSizeBytes: 5 << 20, MaxFiles: 7}
DefaultConfig is the fallback when config resolves to nothing sensible: a 5 MiB size cap and 7 kept rotations (plus daily rolling, which is always on).
Functions ¶
func Append ¶
Append writes line (a trailing newline is added) to path, ROLLING the file over first when it has aged into a new UTC day since its last write or when the write would push it past cfg.MaxSizeBytes. A roll renames path to <base>-<YYYYMMDD-HHMMSS>.log (a numeric suffix breaks a same-second tie), then prunes the oldest rotations beyond cfg.MaxFiles. Best-effort: a mkdir/open error is returned but a caller may ignore it.