Documentation
¶
Overview ¶
Package ui provides cover100's terminal styling and wire-up to github.com/strongo/logus.
The styling vocabulary — the ✓/i/!/✗ glyphs, the bold headers, the dim/cyan helpers, and the plain "ok:"/"info:"/"warn:"/"error:" fallbacks used when stdout is not a terminal — follows the fleet's other Go CLIs so cover100 looks and pipes like the rest of them.
Index ¶
- func Duration(d time.Duration) string
- func IsTTY(w io.Writer) bool
- func Number(n int) string
- func Percent(covered, total int) string
- type LogHandler
- type Printer
- func (p *Printer) Blank()
- func (p *Printer) Block(text string)
- func (p *Printer) Bold(format string, args ...any)
- func (p *Printer) Debugf(format string, args ...any)
- func (p *Printer) Detail(format string, args ...any)
- func (p *Printer) Error(format string, args ...any)
- func (p *Printer) Info(format string, args ...any)
- func (p *Printer) Success(format string, args ...any)
- func (p *Printer) Table(headers []string, rows [][]string)
- func (p *Printer) Verbose() bool
- func (p *Printer) Warn(format string, args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogHandler ¶
type LogHandler struct {
// contains filtered or unexported fields
}
LogHandler adapts github.com/strongo/logus to this Printer. Register it with logus.AddLogEntryHandler so every package that logs through logus lands in cover100's output, filtered by verbosity.
func NewLogHandler ¶
func NewLogHandler(p *Printer) LogHandler
NewLogHandler returns a logus handler backed by p.
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer writes cover100's progress, summary and diagnostics. It is safe for concurrent use: collectors run in parallel and share one Printer.
func New ¶
New returns a Printer writing progress to out and warnings, errors and diagnostics to err. Colour is enabled only when out is a terminal and NO_COLOR is unset.