Documentation ¶
Index ¶
- Variables
- func GetTerminalSize() (width, height int, err error)
- func IsTerminal() bool
- type LogLevel
- type Logger
- func (l *Logger) Ask() bool
- func (l *Logger) Copy() (types.Logger, error)
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(f string, args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(f string, args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(f string, args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(f string, args ...interface{})
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Panicf(f string, args ...interface{})
- func (l *Logger) Screen(text string)
- func (l *Logger) SetContext(name string)
- func (l *Logger) Spinner()
- func (l *Logger) SpinnerStop()
- func (l *Logger) SpinnerText(suffix, prefix string)
- func (l *Logger) Success(args ...interface{})
- func (l *Logger) Trace(args ...interface{})
- func (l *Logger) Tracef(t string, args ...interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(f string, args ...interface{})
- func (l *Logger) Warning(args ...interface{})
- func (l *Logger) Warningf(f string, args ...interface{})
- type LoggerOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var EnableEmoji = func() LoggerOptions { return func(l *Logger) error { l.emoji = true return nil } }
Functions ¶
func GetTerminalSize ¶
GetTerminalSize returns the width and the height of the active terminal.
func IsTerminal ¶
func IsTerminal() bool
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is the default logger
func New ¶
func New(opts ...LoggerOptions) (*Logger, error)
func (*Logger) SetContext ¶
SetContext sets the logger context, used to prefix log lines
func (*Logger) SpinnerStop ¶
func (l *Logger) SpinnerStop()
func (*Logger) SpinnerText ¶
type LoggerOptions ¶
var NoSpinner LoggerOptions = func(l *Logger) error { l.noSpinner = true return nil }
func WithContext ¶
func WithContext(c string) LoggerOptions
func WithFileLogging ¶
func WithFileLogging(p, encoding string) LoggerOptions
func WithLevel ¶
func WithLevel(level string) LoggerOptions
Click to show internal directories.
Click to hide internal directories.