class

Hwaro::Logger::Status

Inherits Reference / Object


Live status region (TTY only)

A single \r-overwriting line that breathes the current phase while work runs, then erases itself so the calm receipt is all that remains in scrollback. It is the ONLY place that emits \r / cursor escapes, and it never activates unless STDOUT is a TTY with color and non-quiet output — so pipes, CI, NO_COLOR, and tests are completely untouched (no fiber, no escapes). Animation is driven by a timer fiber, decoupled from the build's (possibly parallel) work so motion stays smooth regardless of phase.

Constants

INTERVAL = 80.milliseconds
SPINNER = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"] of ::String

Constructors

new(io : IO)
Source

Instance methods

clear_line

Erase the spinner's current line without stopping it — used by the logging methods so an interleaved warning/info prints cleanly and the spinner simply redraws below it on its next tick.

Source
phase(label : String) : Nil

Update the label and redraw immediately. The synchronous redraw is what makes phase progression visible even when CPU-bound work starves the timer fiber (Crystal's scheduler only services the sleep timer at yield points); the timer still adds animation whenever the build yields.

Source
start
Source
stop

Stop the timer fiber and wait for it to erase its line, so subsequent output (the receipt) prints on a clean line. Idempotent.

Source