Documentation ¶
Index ¶
- type Level
- type Printer
- func (p *Printer) Debug(level Level, msg string, args ...any)
- func (p *Printer) Error(msg string, args ...any)
- func (p *Printer) Info(msg string, args ...any)
- func (p *Printer) Outputf(msg string, args ...any)
- func (p *Printer) Outputln(msg string)
- func (p *Printer) PromptForConfirmation(prompt string) error
- func (p *Printer) Warn(msg string, args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Printer ¶
func NewPrinter ¶
func NewPrinter() *Printer
Creates a new printer, including setting up the default logger.
func (*Printer) Debug ¶
Print a Debug level log through the "slog" package. If the verbosity level is not Debug, it does nothing
func (*Printer) Error ¶
Print an Error level output to the defined Err output (falling back to Stderr if not set).
func (*Printer) Info ¶
Print an Info level output to the defined Err output (falling back to Stderr if not set). If the verbosity level is not Debug or Info, it does nothing.
func (*Printer) Outputf ¶
Print an output using Printf to the defined output (falling back to Stderr if not set).
func (*Printer) Outputln ¶
Print an output using Println to the defined output (falling back to Stderr if not set).
func (*Printer) PromptForConfirmation ¶
Prompts the user for confirmation.
Returns nil only if the user (explicitly) answers positive. Returns ErrAborted if the user answers negative.