Documentation ¶
Overview ¶
Package log is a wrapper around the fmt package to print messages to the terminal.
Index ¶
- Variables
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func Serror(args ...interface{}) string
- func Serrorf(format string, args ...interface{}) string
- func Serrorln(args ...interface{}) string
- func Ssuccess(args ...interface{}) string
- func Ssuccessf(format string, args ...interface{}) string
- func Ssuccessln(args ...interface{}) string
- func Success(args ...interface{})
- func Successf(format string, args ...interface{})
- func Successln(args ...interface{})
- func Warning(args ...interface{})
- func Warningf(format string, args ...interface{})
- func Warningln(args ...interface{})
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Debugln(args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Errorln(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) Success(args ...interface{})
- func (l *Logger) Successf(format string, args ...interface{})
- func (l *Logger) Successln(args ...interface{})
- func (l *Logger) Warning(args ...interface{})
- func (l *Logger) Warningf(format string, args ...interface{})
- func (l *Logger) Warningln(args ...interface{})
Constants ¶
This section is empty.
Variables ¶
var ( DiagnosticWriter = color.Error OutputWriter = color.Output )
Decorated io.Writers around standard error and standard output that work on Windows.
Functions ¶
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf formats according to the specifier, colors the message in grey, and writes to standard error.
func Debugln ¶
func Debugln(args ...interface{})
Debugln writes the message to standard error in grey and with a new line.
func Error ¶
func Error(args ...interface{})
Error prefixes the message with a red "✘ Error!", and writes to standard error.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf formats according to the specifier, prefixes the message with a red "✘ Error!", and writes to standard error.
func Errorln ¶
func Errorln(args ...interface{})
Errorln prefixes the message with a red "✘ Error!", and writes to standard error with a new line.
func Info ¶
func Info(args ...interface{})
Info writes the message to standard error with the default color.
func Infof ¶
func Infof(format string, args ...interface{})
Infof formats according to the specifier, and writes to standard error with the default color.
func Infoln ¶
func Infoln(args ...interface{})
Infoln writes the message to standard error with the default color and new line.
func Serror ¶
func Serror(args ...interface{}) string
Serror prefixes the message with a red "✘ Error!", and returns it.
func Serrorf ¶
Serrorf formats according to the specifier, prefixes the message with a red "✘ Error!", and returns it.
func Serrorln ¶
func Serrorln(args ...interface{}) string
Serrorln prefixes the message with a red "✘ Error!", appends a new line, and returns it.
func Ssuccess ¶
func Ssuccess(args ...interface{}) string
Ssuccess prefixes the message with a green "✔ Success!", and returns it.
func Ssuccessf ¶
Ssuccessf formats according to the specifier, prefixes the message with a green "✔ Success!", and returns it.
func Ssuccessln ¶
func Ssuccessln(args ...interface{}) string
Ssuccessln prefixes the message with a green "✔ Success!", appends a new line, and returns it.
func Success ¶
func Success(args ...interface{})
Success prefixes the message with a green "✔ Success!", and writes to standard error.
func Successf ¶
func Successf(format string, args ...interface{})
Successf formats according to the specifier, prefixes the message with a green "✔ Success!", and writes to standard error.
func Successln ¶
func Successln(args ...interface{})
Successln prefixes the message with a green "✔ Success!", and writes to standard error with a new line.
func Warning ¶
func Warning(args ...interface{})
Warning prefixes the message with a "Note:", colors the *entire* message in yellow, writes to standard error.
Types ¶
type Logger ¶ added in v1.19.0
type Logger struct {
// contains filtered or unexported fields
}
Logger represents a logging object that writes to an io.Writer lines of outputs.
func (*Logger) Debug ¶ added in v1.19.0
func (l *Logger) Debug(args ...interface{})
Debug writes the message.
func (*Logger) Debugf ¶ added in v1.19.0
Debugf formats according to the specifier, and writes the message.
func (*Logger) Debugln ¶ added in v1.19.0
func (l *Logger) Debugln(args ...interface{})
Debugln writes the message and with a new line.
func (*Logger) Error ¶ added in v1.19.0
func (l *Logger) Error(args ...interface{})
Error writes args prefixed with "✘ Error!".
func (*Logger) Errorf ¶ added in v1.19.0
Errorf formats according to the specifier, prefixes the message with a "✘ Error!", and writes it.
func (*Logger) Errorln ¶ added in v1.19.0
func (l *Logger) Errorln(args ...interface{})
Errorln writes args prefixed with a "✘ Error!" and a new line.
func (*Logger) Info ¶ added in v1.19.0
func (l *Logger) Info(args ...interface{})
Info writes the message.
func (*Logger) Infof ¶ added in v1.19.0
Infof formats according to the specifier, and writes the message.
func (*Logger) Infoln ¶ added in v1.19.0
func (l *Logger) Infoln(args ...interface{})
Infoln writes the message with a new line.
func (*Logger) Success ¶ added in v1.19.0
func (l *Logger) Success(args ...interface{})
Success writes args prefixed with a "✔ Success!".
func (*Logger) Successf ¶ added in v1.19.0
Successf formats according to the specifier, prefixes the message with a "✔ Success!", and writes it.
func (*Logger) Successln ¶ added in v1.19.0
func (l *Logger) Successln(args ...interface{})
Successln writes args prefixed with a "✔ Success!" and a new line.
func (*Logger) Warning ¶ added in v1.19.0
func (l *Logger) Warning(args ...interface{})
Warning writes args prefixed with "Note:".