comm

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(noProgress, quiet, verbose, json, panic bool, assumeYes bool, adamLovesBeeps bool)

Configure sets all logging options in one go

func Debug

func Debug(msg string)

Debug messages are like Info messages, but printed only when verbose

func Debugf

func Debugf(format string, args ...interface{})

Debugf is a formatted variant of Debug

func Die

func Die(msg string)

Die exits with a non-zero exit code after giving a reson to the client

func Dief

func Dief(format string, args ...interface{})

Dief is a formatted variant of Die

func EndProgress

func EndProgress()

EndProgress stops refreshing the progress bar and erases it.

func Log

func Log(msg string)

Log sends an informational message to the client

func Logf

func Logf(format string, args ...interface{})

Logf sends a formatted informational message to the client

func Logl

func Logl(level string, msg string)

Logl logs a message of a given level

func Loglf

func Loglf(level string, format string, args ...interface{})

Loglf logs a formatted message of a given level

func NewStateConsumer

func NewStateConsumer() *state.Consumer

NewStateConsumer returns an implementor of `pwr.StateConsumer` that prints directly to the console via butler's logging functions.

func Notice

func Notice(header string, lines []string)

Notice prints a box with important info in it. UX style guide: don't abuse it or people will stop reading it.

func Opf

func Opf(format string, args ...interface{})

Opf prints a formatted string informing the user on what operation we're doing

func PauseProgress

func PauseProgress()

PauseProgress temporarily stops printing the progress bar

func Progress

func Progress(alpha float64)

Progress sets the completion of a task whose progress is being printed It only has an effect if StartProgress was already called.

func ProgressLabel

func ProgressLabel(label string)

ProgressLabel sets the string printed next to the progress indicator

func ProgressScale

func ProgressScale(scale float64)

ProgressScale sets the scale on which the progress bar is displayed. This can be useful when the progress value evolves in another interval than [0, 1]

func ResumeProgress

func ResumeProgress()

ResumeProgress resumes printing the progress bar after PauseProgress was called

func StartProgress

func StartProgress()

StartProgress begins a period in which progress is regularly printed

func StartProgressWithTotalBytes added in v1.3.0

func StartProgressWithTotalBytes(totalBytes int64)

StartProgressWithTotalBytes begins a period in which progress is regularly printed, and bps (bytes per second) is estimated from the total size given

func Statf

func Statf(format string, args ...interface{})

Statf prints a formatted string informing the user how fast the operation went

func Warn

func Warn(msg string)

Warn lets the user know about a problem that's non-critical

func Warnf

func Warnf(format string, args ...interface{})

Warnf is a formatted variant of Warn

func YesNo

func YesNo(question string) bool

YesNo asks the user whether to proceed or not won't work in json mode for now.

Types

type ProgressTheme

type ProgressTheme struct {
	BarStart        string
	BarEnd          string
	Current         string
	CurrentHalfTone string
	Empty           string
	OpSign          string
	StatSign        string
}

ProgressTheme contains all the characters we need to show progress

func GetTheme

func GetTheme() *ProgressTheme

GetTheme returns the theme used to show progress

Jump to

Keyboard shortcuts

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