Documentation
¶
Overview ¶
Package runlog manages per-command session log files.
Verbose commands (git bulk syncs, system updates) produce far more output than fits a clean terminal summary. runlog captures the full log stream to a timestamped file under the OS cache dir while the terminal shows only the summary. Use `eng logs show` to inspect a past run.
File logging is skipped when ui.DisableProgress is set. That flag is only ever set by tests, so production runs always log while `go test` never touches the real cache directory.
Index ¶
Constants ¶
const KeepRuns = 20
KeepRuns is how many recent session logs are retained. Older files are pruned whenever a new session starts.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
Dir returns the session log directory, creating it if needed. ENG_LOG_DIR overrides the default (OS cache dir), which also keeps tests hermetic.
func Finish ¶
func Finish(path string)
Finish prints the "full log" pointer line. It is a no-op for empty paths, so commands can `defer runlog.Finish(path)` unconditionally: the pointer always lands after the command summary.
func ParseName ¶
ParseName splits a session log filename into its command slug and timestamp. Unknown shapes return the raw base name and the zero time.