Documentation ¶
Index ¶
- type Activity
- func (a *Activity) EndWithFailure(message interface{})
- func (a *Activity) EndWithFailuref(format string, args ...interface{})
- func (a *Activity) EndWithSuccess()
- func (a *Activity) EndWithSuccessAndEmitLogs()
- func (a *Activity) EndWithWarning(message interface{})
- func (a *Activity) EndWithWarningf(format string, args ...interface{})
- func (a *Activity) Log(message string)
- func (a *Activity) Logf(format string, args ...interface{})
- func (a *Activity) Logs() string
- func (a *Activity) Writer() io.Writer
- type Logger
- func (log *Logger) Errorf(format string, args ...interface{})
- func (log *Logger) Printf(s string, args ...interface{})
- func (log *Logger) Println(s ...interface{})
- func (log *Logger) StartActivity(format string, args ...interface{}) *Activity
- func (log *Logger) Successf(format string, args ...interface{})
- func (log *Logger) Warnf(format string, args ...interface{})
- func (log *Logger) Writer() io.Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Activity ¶
type Activity struct {
// contains filtered or unexported fields
}
Activity is a buffered logger associated with an on-screen spinner. As well as being able to signal completion state (EndWithSuccess, EndWithWarning and EndWithFailure), logs can be buffered. Whether or not the logs are actually displayed depends on the completion state.
func (*Activity) EndWithFailure ¶
func (a *Activity) EndWithFailure(message interface{})
func (*Activity) EndWithFailuref ¶
func (*Activity) EndWithSuccess ¶
func (a *Activity) EndWithSuccess()
func (*Activity) EndWithSuccessAndEmitLogs ¶
func (a *Activity) EndWithSuccessAndEmitLogs()
func (*Activity) EndWithWarning ¶
func (a *Activity) EndWithWarning(message interface{})
func (*Activity) EndWithWarningf ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a facade for CLI logging.
func NewLogger ¶
NewLogger creates a Logger associated with a particular *cobra.Command instance. Logs will be delivered to the command's stdout writer.
func (*Logger) StartActivity ¶
StartActivity creates and starts an *Activity with an associated spinner. Only once Activity should be active at any given time, and the Activity should be completed before any other logging is performed using this Logger.