Documentation
¶
Overview ¶
Package style is how Probe shows a status in a terminal: its icon and its color. Probe prints a run with it, and an action can write what it reports under its step with it, so that a status looks the same there as in the rest of the run.
An action runs in a process of its own, whose standard output is not the terminal, so it would print no color by itself. Probe sets PROBE_TTY to 1 in the environment of the action when it prints to a terminal, and a mark is colored then, as it is when FORCE_COLOR is 1.
fmt.Fprintf(&b, "%s %s\n", style.Success, "the page shows the name")
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mark ¶
type Mark int
Mark is a status as Probe shows it.
const ( // Success is what passed: a green ✓. Success Mark = iota // Failure is what failed: a red ✗. Failure // NoTest is what ran with nothing to check it: a blue △. NoTest // Skipped is what was not run: a blue ⏭. Skipped // Warning is what did not fail but should be looked into: a yellow ⚠︎. Warning // Info is what is told for the reader to know: a blue ⏺. Info )
func NoteLevel ¶
NoteLevel is the Mark of a note of level, as actionrpc names the levels: Failure for "critical", Warning for "warning" and Info for "info". A level that is none of these is Warning.
func (Mark) Color ¶
Color is the color of m, yellow for a Mark that is none of the above. It colors what it prints by color.NoColor, as Probe's own printer, which sets it, does; Paint and String color by Colored.
func (Mark) Icon ¶
Icon is the icon of m, without color, or "?" for a Mark that is none of the above.