Documentation
¶
Index ¶
- Constants
- func ToStdErr() option
- func WithColor(mode ColorMode) option
- func WithErrorTarget(out io.Writer) option
- func WithTarget(out io.Writer) option
- type ColorMode
- type Minimal
- func (m *Minimal) Error(a ...any) error
- func (m *Minimal) Errorf(format string, a ...any) error
- func (m *Minimal) Errorln(a ...any) error
- func (m *Minimal) Info(a ...any) error
- func (m *Minimal) Infof(format string, a ...any) error
- func (m *Minimal) Infoln(a ...any) error
- func (m *Minimal) MustExit(err error)
- func (m *Minimal) MustFail(err error)
- func (m *Minimal) Step(a ...any) error
- func (m *Minimal) Stepf(format string, a ...any) error
- func (m *Minimal) Stepln(a ...any) error
- func (m *Minimal) Sub(a ...any) error
- func (m *Minimal) Subf(format string, a ...any) error
- func (m *Minimal) Subln(a ...any) error
- func (m *Minimal) Success(a ...any) error
- func (m *Minimal) Successf(format string, a ...any) error
- func (m *Minimal) Successln(a ...any) error
- func (m *Minimal) Warn(a ...any) error
- func (m *Minimal) Warnf(format string, a ...any) error
- func (m *Minimal) Warnln(a ...any) error
- func (m *Minimal) Write(color string, a ...any) error
- func (m *Minimal) Writef(color, format string, a ...any) error
- func (m *Minimal) Writeln(color string, a ...any) error
Constants ¶
const ( AnsiSub = ansi.AnsiHiBlack AnsiStep = ansi.AnsiHiBlue AnsiInfo = ansi.AnsiCyan AnsiSuccess = ansi.AnsiGreen AnsiWarn = ansi.AnsiYellow AnsiError = ansi.AnsiRed AnsiReset = ansi.AnsiReset )
Variables ¶
This section is empty.
Functions ¶
func WithColor ¶
func WithColor(mode ColorMode) option
WithColor controls when the logger emits ANSI color sequences.
func WithErrorTarget ¶
WithErrorTarget sets the error output writer used by the logger.
func WithTarget ¶
WithTarget sets the standard output writer used by the logger.
Types ¶
type Minimal ¶
type Minimal struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...option) *Minimal
New creates a Minimal logger configured by the provided options.
func (*Minimal) Errorf ¶
Errorf formats according to a format specifier and writes to the error target as an error message.
func (*Minimal) Errorln ¶
Errorln writes its operands to the error target as an error message with a trailing newline.
func (*Minimal) Infof ¶
Infof formats according to a format specifier and writes to the standard target as an info message.
func (*Minimal) Infoln ¶
Infoln writes its operands to the standard target as an info message with a trailing newline.
func (*Minimal) Step ¶ added in v1.6.2
Step writes its operands to the standard target as a step message.
func (*Minimal) Stepf ¶ added in v1.6.2
Stepf formats according to a format specifier and writes to the standard target as a step message.
func (*Minimal) Stepln ¶ added in v1.6.2
Stepln writes its operands to the standard target as a step message with a trailing newline.
func (*Minimal) Subf ¶
Subf formats according to a format specifier and writes to the standard target as a sub-message.
func (*Minimal) Subln ¶
Subln writes its operands to the standard target as a sub-message with a trailing newline.
func (*Minimal) Successf ¶
Successf formats according to a format specifier and writes to the standard target as a success message.
func (*Minimal) Successln ¶
Successln writes its operands to the standard target as a success message with a trailing newline.
func (*Minimal) Warnf ¶
Warnf formats according to a format specifier and writes to the standard target as a warning.
func (*Minimal) Warnln ¶
Warnln writes its operands to the standard target as a warning with a trailing newline.
func (*Minimal) Write ¶
Write writes its operands to the standard target using the provided ANSI color code.