display

package
v0.7.8-1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2018 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package display implements functions for displaying output to users.

Index

Constants

This section is empty.

Variables

View Source
var TestHandler log.Handler

TestHandler collects log entries during testing.

Functions

func ClearProgress

func ClearProgress()

ClearProgress stops a progress spinner.

func File

func File() string

File returns the log file name.

func Handler

func Handler(entry *log.Entry) error

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 JSON

func JSON(data interface{}) (int, error)

JSON is a convenience function for printing JSON to STDOUT.

func SetDebug

func SetDebug(debug bool)

SetDebug turns debug logging to STDERR on or off.

The log file always writes debug-level entries.

func SetFile

func SetFile(filename string) error

SetFile sets the log file. By default, this is set to a temporary file.

func SetInteractive

func SetInteractive(interactive bool)

SetInteractive turns colors and ANSI control characters on or off.

func Template

func Template(tmpl *template.Template, data interface{}) (string, error)

Template renders a template and its context to a string.

func TemplateFile

func TemplateFile(filename string, data interface{}) (string, error)

TemplateFile renders a template file and its context to string.

func Test

func Test()

Test sets up logging with testing defaults.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL