Documentation
¶
Index ¶
- Variables
- func Debug(message string, fmtArgs ...interface{})
- func DebugNoColor(message string, fmtArgs ...interface{})
- func Error(message string, fmtArgs ...interface{})
- func ErrorDisplay(msg string, err error, fmtArgs ...interface{})
- func FormatErrors(err error) string
- func IncrementProgressBar(onDone ...func())
- func Info(message string, fmtArgs ...interface{})
- func List(list []string, format string, separator string) string
- func Log(verb string, color string, message string, fmtArgs ...interface{})
- func LogNoColor(verb string, color string, message string, fmtArgs ...interface{})
- func LogNoFormatting(verb string, color string, message string)
- func ProgressBarFinished() bool
- func ShowingColors() bool
- func StartProgressBar(total int, verb string, color string)
- func StopProgressBar()
- func TimeTrack(start time.Time, job string, args ...interface{})
- func Timing(job string, args []interface{}, timeTaken time.Duration)
- func UpdateProgressBar(verb string, color string, message string, details ...string)
- func Warn(message string, fmtArgs ...interface{})
- func WarnDisplay(msg string, err error, fmtArgs ...interface{})
Constants ¶
This section is empty.
Variables ¶
var LogFilePath string
Set to a path to log to a file as well as stdout.
var PrependDateToLogs = false
Set to true to prepend the date to logs.
Functions ¶
func Debug ¶
func Debug(message string, fmtArgs ...interface{})
Debug logs debug information. Set DEBUG environment variable to enable.
func DebugNoColor ¶
func DebugNoColor(message string, fmtArgs ...interface{})
DebugNoColor logs debug information without applying colorstring syntax to message.
func ErrorDisplay ¶
func FormatErrors ¶
FormatErrors returns a string where the error message was split on ': ', and each item is on a new line, indented once more than the previous line.
func IncrementProgressBar ¶
func IncrementProgressBar(onDone ...func())
func LogNoColor ¶
LogNoColor logs a message without applying colorstring syntax to message.
func LogNoFormatting ¶
func ProgressBarFinished ¶
func ProgressBarFinished() bool
func ShowingColors ¶
func ShowingColors() bool
ShowingColors returns true if colors (ANSI escape codes) should be printed. Environment variables can control this: NO_COLOR=1 disables colors, and FORCE_COLOR=1 forces colors. Otherwise, heuristics (such as whether the output is an interactive terminal) are used.
func StartProgressBar ¶
func StopProgressBar ¶
func StopProgressBar()
func TimeTrack ¶
TimeTrack logs the time taken for a function to execute, and logs out the time taken. Usage: at the top of your function, defer TimeTrack(time.Now(), "your job name"). To enable, set DEBUG_TIMING environment variable.
func Timing ¶
Timing logs timing debug logs. Mostly used with TimeTrack. To enable, set DEBUG_TIMING environment variable.
func UpdateProgressBar ¶
func WarnDisplay ¶
Types ¶
This section is empty.