Expand description
Shared stderr progress/timing log.
This lives in the foundation crate so every component — CLI stages and the
sub-commands plugins shell out to (git, cargo metadata, rustc) — emits
one consistent line format. All output goes to stderr (machine output and
artifacts go to stdout/files), prefixed with a local HH:MM:SS.mmm stamp.
Durations are printed to millisecond precision (0.231s).
Functions§
- line
- Emit one stamped line to stderr:
[HH:MM:SS.mmm] <msg>. - secs
- Format a duration as seconds with millisecond precision, e.g.
0.231s,29.900s. The single authority for how timings render across the tool. - stamp
- Local wall-clock stamp,
HH:MM:SS.mmm. - subcmd
- Log a completed internal sub-command (an external tool code-split shelled out
to) with its duration:
[HH:MM:SS.mmm] ↳ <label> — 0.231s. The↳marks it as a nested step under the current stage. - timed
- Time
f, log it as a sub-command (seesubcmd), and return its value. Wrap everygit/cargo/rustcinvocation in this so the cost of each external call is visible — these dominate the wall clock on a cold cache.