Documentation ¶
Index ¶
- type Config
- type Logger
- func (l *Logger) Debug(a ...interface{})
- func (l *Logger) Deprecate(a ...interface{})
- func (l *Logger) Error(a ...interface{})
- func (l *Logger) Info(a ...interface{})
- func (l Logger) PrintCommand(command string, namespaces ...string)
- func (l Logger) PrintCommandError(err error)
- func (l Logger) PrintCommandWithParenthetical(command, parenthetical string, namespaces ...string)
- func (l Logger) PrintEnvironment(variables map[string]*string)
- func (l Logger) PrintSkipped(command, reason string)
- func (l Logger) PrintTask(taskName string)
- func (l Logger) PrintTaskCompleted(taskName string)
- func (l Logger) PrintTaskFinally(taskName string)
- func (l *Logger) Println(a ...interface{})
- func (l *Logger) Warn(a ...interface{})
- type VerbosityLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.6.0
type Config struct {
VerbosityLevel
}
Config is the configuration for a logger.
type Logger ¶ added in v0.6.0
type Logger struct {
Stdout, Stderr io.Writer
Verbosity VerbosityLevel
// contains filtered or unexported fields
}
Logger writes CLI output at the appropriate level.
func (*Logger) Debug ¶ added in v0.6.0
func (l *Logger) Debug(a ...interface{})
Debug prints debug information.
func (*Logger) Deprecate ¶ added in v0.6.0
func (l *Logger) Deprecate(a ...interface{})
Deprecate prints deprecation warnings no more than once.
func (*Logger) Error ¶ added in v0.6.0
func (l *Logger) Error(a ...interface{})
Error prints application errors.
func (*Logger) Info ¶ added in v0.6.0
func (l *Logger) Info(a ...interface{})
Info prints normal application information.
func (Logger) PrintCommand ¶ added in v0.6.0
PrintCommand prints the command to be executed.
func (Logger) PrintCommandError ¶ added in v0.6.0
PrintCommandError prints an error from a running command.
func (Logger) PrintCommandWithParenthetical ¶ added in v0.6.0
PrintCommandWithParenthetical prints a command with additional information.
func (Logger) PrintEnvironment ¶ added in v0.6.0
PrintEnvironment prints when environment variables are set.
func (Logger) PrintSkipped ¶ added in v0.6.0
PrintSkipped prints the command skipped and the reason.
func (Logger) PrintTaskCompleted ¶ added in v0.6.0
PrintTaskCompleted prints when a task has completed.
func (Logger) PrintTaskFinally ¶ added in v0.6.0
PrintTaskFinally prints when a task's finally clause has begun.
type VerbosityLevel ¶ added in v0.2.0
type VerbosityLevel int
VerbosityLevel describes the verbosity of output.
const ( // VerbosityLevelSilent does not print any output to stderr/stdout. VerbosityLevelSilent VerbosityLevel = iota // VerbosityLevelQuiet only prints command output and error messages. VerbosityLevelQuiet VerbosityLevel = iota // VerbosityLevelNormal is the normal level of verbosity. VerbosityLevelNormal VerbosityLevel = iota // VerbosityLevelVerbose prints all messages, include debug info. VerbosityLevelVerbose VerbosityLevel = iota )
func (VerbosityLevel) String ¶ added in v0.2.0
func (v VerbosityLevel) String() string