Documentation
¶
Overview ¶
Package applog is the single owner of where process log output goes.
The log file is a disposable diagnostic, never origin data: it is not exported, not synced, and not the record of anything. Call sites keep using the standard log package; this package only sets the destination and scrubs credential-shaped bytes on the way in.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Install ¶
Install opens <dir>/logs/gadak.log and points the standard log package at a writer that scrubs credential-shaped bytes, appends them to that file, and mirrors them to stderr. A second call in one process is a no-op that returns the same closer.
A file that cannot be opened (a read-only home is a supported state) does not fail the process: Install logs one line to stderr and continues with stderr-only output plus the in-memory ring. The returned error names the open failure; callers at process start must ignore it.
func Recent ¶
Recent returns the last n lines written through Install, oldest first. n is capped at 500. Without Install, the result is empty.
func Tail ¶
Tail returns the last n lines of the log file at Path(dir), oldest first. It exists because the ring is process-local and `gadak doctor` is its own process: without this, doctor's log section can only ever be empty, which is the one place the lines were meant to be pasteable from.
The bytes on disk are already scrubbed, but they were scrubbed by whichever build wrote them; running them back through scrub costs nothing and keeps the never-print rule owned here rather than at the reader.
Types ¶
This section is empty.