Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Done ¶
func Done(suffix ...string)
Done marks the current task as successfully completed. An optional note is appended after the task label, e.g. Done("(hits 50)").
func NoColor ¶ added in v0.0.6
func NoColor()
NoColor disables color output in TTY mode, using plain black & white styles. Must be called before Start.
func NoTTY ¶ added in v0.0.6
func NoTTY()
NoTTY forces log-mode output (structured slog records, no colour, no spinner) even when stderr is an interactive terminal. Must be called before Start.
Types ¶
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter manages progress output using one of two printer strategies: ttyPrinter (colours + spinner) when stderr is an interactive terminal, or logPrinter (structured slog records) otherwise.
func NewReporter ¶
func NewReporter() *Reporter
NewReporter creates a Reporter that writes to stderr, automatically selecting the ttyPrinter or logPrinter strategy based on whether stderr is a terminal. If NoTTY has been called, logPrinter is always used regardless of the terminal.
func (*Reporter) Done ¶
Done marks the current (innermost) task as successfully completed. An optional note is appended after the task label, e.g. Done("(hits 50)").
func (*Reporter) Fail ¶
Fail marks the current (innermost) task as failed. err is printed beneath the task line (ttyPrinter) or included as a structured field (logPrinter).
func (*Reporter) Printf ¶ added in v0.0.4
Printf prints a formatted message indented under the current task.
func (*Reporter) Quit ¶
func (r *Reporter) Quit()
Quit stops any animation and marks all remaining tasks as done.