Documentation ¶
Overview ¶
Package log contains logging related functionality
Index ¶
- func Askf(format string, a ...interface{})
- func Error(a ...interface{})
- func Errorf(format string, a ...interface{})
- func Info(a ...interface{})
- func Infof(format string, a ...interface{})
- func IsDebug() bool
- func IsTerminal(w io.Writer) bool
- func Namef(format string, a ...interface{})
- func Progressf(format string, a ...interface{})
- func Successf(format string, a ...interface{})
- type Status
- type StatusFriendlyWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Askf ¶
func Askf(format string, a ...interface{})
Askf will print out information, but in an "Ask" way (without newline)
func Errorf ¶
func Errorf(format string, a ...interface{})
Errorf will output in an appropriate "progress" manner
func Info ¶
func Info(a ...interface{})
Info will simply print out information on a new (bolded) line this is intended as information *after* something has been deployed
func Infof ¶
func Infof(format string, a ...interface{})
Infof will simply print out information on a new (bolded) line this is intended as information *after* something has been deployed
func IsDebug ¶
func IsDebug() bool
IsDebug returns true if we are debugging (-v is set to anything but 0)
func IsTerminal ¶
IsTerminal returns true if the writer w is a terminal
func Namef ¶
func Namef(format string, a ...interface{})
Namef will output the name of the component / application / project in a *bolded* manner
Types ¶
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status is used to track ongoing status in a CLI, with a nice loading spinner when attached to a terminal
func Spinner ¶
Status creates a spinner, sets the prefix then returns it. Remember to use .End(bool) to stop the spin / when you're done. For example: defer s.End(false)
func Spinnerf ¶
Statusf creates a spinner, sets the prefix then returns it. Remember to use .End(bool) to stop the spin / when you're done. For example: defer s.End(false)
func (*Status) End ¶
End completes the current status, ending any previous spinning and marking the status as success or failure
func (*Status) MaybeWrapWriter ¶
MaybeWrapWriter returns a StatusFriendlyWriter for w IFF w and spinner's output are a terminal, otherwise it returns w
type StatusFriendlyWriter ¶
type StatusFriendlyWriter struct {
// contains filtered or unexported fields
}
StatusFriendlyWriter is used to wrap another Writer to make it toggle the status spinner before and after writes so that they do not collide