Documentation
¶
Index ¶
- Variables
- type Color
- type Logger
- func (l *Logger) Errf(color Color, s string, args ...any)
- func (l *Logger) FOutf(w io.Writer, color Color, s string, args ...any)
- func (l *Logger) Outf(color Color, s string, args ...any)
- func (l *Logger) Prompt(color Color, prompt string, defaultValue string, continueValues ...string) error
- func (l *Logger) VerboseErrf(color Color, s string, args ...any)
- func (l *Logger) VerboseOutf(color Color, s string, args ...any)
- func (l *Logger) Warnf(message string, args ...any)
- type PrintFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPromptCancelled = errors.New("prompt cancelled") ErrNoTerminal = errors.New("no terminal") )
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
Verbose bool
Color bool
AssumeYes bool
AssumeTerm bool // Used for testing
}
Logger is just a wrapper that prints stuff to STDOUT or STDERR, with optional color.
func (*Logger) VerboseErrf ¶
VerboseErrf prints stuff to STDERR if verbose mode is enabled.
func (*Logger) VerboseOutf ¶
VerboseOutf prints stuff to STDOUT if verbose mode is enabled.
Click to show internal directories.
Click to hide internal directories.