Documentation
¶
Overview ¶
Package logging provides structured JSONL logging for scut commands. Log files are written to ~/.scut/logging/ with date and component name in the filename. Files are rotated on open when they exceed 10 MB.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Discard = slog.New(slog.NewTextHandler(io.Discard, nil))
Discard is a no-op logger that discards all output. Use it when logging is disabled so callers don't need nil checks.
Functions ¶
func LogParseError ¶
LogParseError appends a JSONL record describing a kong parse failure to ~/.scut/logging/YYYYMMDD_parse-errors.jsonl. It is unconditional — parse errors are always bugs worth capturing, so no flag gates them. Failure to write is swallowed: losing the record must not prevent the parent process from seeing the original kong error on stderr.
func Open ¶
Open creates or opens a JSONL log file for the named component (e.g. "post-tool-use", "status-line"). The file is placed at ~/.scut/logging/YYYYMMDD_<name>.jsonl.
If the file already exists and exceeds maxFileSize, it is rotated (renamed with a unix-second suffix) before opening a fresh file.
The returned io.Closer must be called when logging is complete.
Types ¶
This section is empty.