Documentation
¶
Index ¶
- Constants
- func AsStrings[T any](input []T) []string
- func WithDate(format string) option
- func WithTarget(out io.Writer) option
- type Plain
- func (p *Plain) Close() error
- func (p *Plain) Confirm(prompt string, defaultYes bool) (bool, error)
- func (p *Plain) Debug(a ...any)
- func (p *Plain) Debugf(format string, a ...any)
- func (p *Plain) Debugln(a ...any)
- func (p *Plain) Error(a ...any)
- func (p *Plain) Errorf(format string, a ...any)
- func (p *Plain) Errorln(a ...any)
- func (p *Plain) HandleInterrupt(fn ...func())
- func (p *Plain) LogRequest(request *http.Request, metrics *httpsnoop.Metrics)
- func (p *Plain) Middleware() func(http.Handler) http.Handler
- func (p *Plain) MustFail(err error)
- func (p *Plain) Print(a ...any)
- func (p *Plain) Printf(format string, a ...any)
- func (p *Plain) Println(a ...any)
- func (p *Plain) Read(prompt string, max int) (string, error)
- func (p *Plain) ReadOne(prompt string) (rune, error)
- func (p *Plain) Select(prompt string, options []string) (int, error)
- func (p *Plain) Warn(a ...any)
- func (p *Plain) Warnf(format string, a ...any)
- func (p *Plain) Warnln(a ...any)
- func (p *Plain) Write(code, msg string, reset, nl bool)
- type Theme
Constants ¶
const ( RFC3339Local = "2006-01-02T15:04:05" Reset = "\x1b[0m" )
const ( ModeNone = iota - 1 ModeSome Mode8Bit ModeFull )
Variables ¶
This section is empty.
Functions ¶
func WithTarget ¶
Types ¶
type Plain ¶
type Plain struct {
// contains filtered or unexported fields
}
func (*Plain) Confirm ¶
Confirm displays a prompt aligned with the logger's format and reads y/n confirmation from stdin.
func (*Plain) Debug ¶
Debug formats using the default formats for its operands and writes to the target output as a debug log.
func (*Plain) Debugf ¶
Debugf formats according to a format specifier and writes to the target output as a debug log.
func (*Plain) Debugln ¶
Debugln formats using the default formats for its operands and writes to the target output as a debug log with a trailing newline.
func (*Plain) Error ¶
Error formats using the default formats for its operands and writes to the target output as an error.
func (*Plain) Errorf ¶
Errorf formats according to a format specifier and writes to the target output as an error.
func (*Plain) Errorln ¶
Errorln formats using the default formats for its operands and writes to the target output as an error with a trailing newline.
func (*Plain) HandleInterrupt ¶ added in v1.1.4
func (p *Plain) HandleInterrupt(fn ...func())
func (*Plain) LogRequest ¶
func (*Plain) Print ¶
Print formats using the default formats for its operands and writes to the target output.
func (*Plain) Printf ¶
Printf formats according to a format specifier and writes to the target output.
func (*Plain) Println ¶
Println formats using the default formats for its operands and writes to the target output with a trailing newline.
func (*Plain) Read ¶
Read displays a prompt aligned with the logger's format and reads max bytes from stdin.
func (*Plain) ReadOne ¶
ReadOne displays a prompt aligned with the logger's format and reads 1 byte from stdin.
func (*Plain) Warn ¶
Warn formats using the default formats for its operands and writes to the target output as a warning.
func (*Plain) Warnf ¶
Warnf formats according to a format specifier and writes to the target output as a warning.