Documentation ¶
Overview ¶
Package log contains logging related functionality
Package log contains logging related functionality
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTerminal ¶
IsTerminal returns true if the writer w is a terminal
func LevelsString ¶
func LevelsString() string
LevelsString returns a string representing all log levels this is useful for help text / flag info
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 (*Status) End ¶
End completes the current status, ending any previous spinning and marking the status as success or failure
func (*Status) MaybeWrapLogrus ¶
MaybeWrapLogrus behaves like MaybeWrapWriter for a logrus logger
func (*Status) MaybeWrapWriter ¶
MaybeWrapWriter returns a StatusFriendlyWriter for w IFF w and spinner's output are a terminal, otherwise it returns w
func (*Status) Start ¶
Start starts a new phase of the status, if attached to a terminal there will be a loading spinner with this status
func (*Status) WrapLogrus ¶
WrapLogrus wraps a logrus logger's output with a StatusFriendlyWriter
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