Documentation ¶
Index ¶
- type Logger
- func (l *Logger) Debug(format string, args ...interface{})
- func (l *Logger) Error(msg string, err error)
- func (l *Logger) ErrorF(err error, format string, args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Infoln(args ...interface{})
- func (l *Logger) Prettyify(data interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger wraps a few log.Logger instances in private fields. They are accessible via their respective methods.
func NewLogger ¶
NewLogger returns a reference to a Logger. We usually call this when initializing cmd.Logger. Later we pass this to client.NewClient so it can also log. By default debug and error go to os.Stderr, and info goes to os.Stdout
func (*Logger) Debug ¶
Debug prints a formatted message to stderr only if debug is set. Consider these messages useful for developers of the CLI. This method wraps log.Logger.Printf
func (*Logger) Error ¶
Error prints a message and the given error's message to os.Stderr This method wraps log.Logger.Print
func (*Logger) ErrorF ¶ added in v0.1.3807
ErrorF prints a formatted message given the error to os.Stderr
func (*Logger) Info ¶
func (l *Logger) Info(args ...interface{})
Info prints all args to os.Stdout It's commonly used for messages we want to show the user. This method wraps log.Logger.Print
func (*Logger) Infof ¶
Infof prints a formatted message to stdout This method wraps log.Logger.Printf