Documentation ¶
Overview ¶
Package display implements functions for displaying output to users.
Index ¶
- Variables
- func ClearProgress()
- func File() string
- func Handler(entry *log.Entry) error
- func InProgress(message string)
- func JSON(data interface{}) (int, error)
- func SetDebug(debug bool, setVerbose bool)
- func SetFile(filename string) error
- func SetInteractive(interactive bool)
- func Template(tmpl *template.Template, data interface{}) (string, error)
- func TemplateFile(filename string, data interface{}) (string, error)
- func TemplateFormatTabs(tmpl string, data interface{}, minWidth, tabWidth, padding int) (string, error)
- func TemplateString(templateString string, data interface{}) (string, error)
- func Test()
Constants ¶
This section is empty.
Variables ¶
var TestHandler log.Handler
TestHandler collects log entries during testing.
Functions ¶
func Handler ¶
Handler handles log entries. It multiplexes them into two outputs, writing human-readable messages to STDERR and machine-readable entries to a log file.
TODO: does this need to be synchronised?
func InProgress ¶
func InProgress(message string)
InProgress shows a progress spinner with a message.
func SetDebug ¶
SetDebug turns debug logging to STDERR on or off.
The log file always writes debug-level entries.
func SetInteractive ¶
func SetInteractive(interactive bool)
SetInteractive turns colors and ANSI control characters on or off.
func TemplateFile ¶
TemplateFile renders a template file and its context to string.
func TemplateFormatTabs ¶ added in v0.7.27
func TemplateFormatTabs(tmpl string, data interface{}, minWidth, tabWidth, padding int) (string, error)
TemplateFormatTabs renders a template with the desired tab format.
func TemplateString ¶ added in v0.7.27
TemplateString renders a template from a string template.
Types ¶
This section is empty.