log

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start()

Start starts the logging output

func Stop

func Stop()

Stop halts updating the output

Types

type Line

type Line struct {
	Text string
	// contains filtered or unexported fields
}

Line is single text line in the terminal output what you can change afterward

func NewLine

func NewLine() *Line

NewLine creates new updateable output Line

func (*Line) Done

func (r *Line) Done(a ...interface{}) *Line

Done marks this line to be done and updates the text

func (*Line) Donef

func (r *Line) Donef(format string, args ...interface{}) *Line

Donef marks this line to be done and updates the text

func (*Line) Error

func (r *Line) Error(a ...interface{}) *Line

Error mark this line to be in error with given message

func (*Line) Errorf

func (r *Line) Errorf(format string, args ...interface{}) *Line

Errorf mark this line to be in error with given format

func (*Line) Fatal

func (r *Line) Fatal(a ...interface{})

Fatal mark this line to be in error with given message Will exit(1) after rerendering the lines

func (*Line) Fatalf

func (r *Line) Fatalf(format string, args ...interface{})

Fatalf mark this line to be in fatal with given format Will exit(1) after rerendering the lines

func (*Line) GetProgress

func (r *Line) GetProgress() (int64, int64)

func (*Line) Info

func (r *Line) Info(a ...interface{}) *Line

Info mark this line to be just blank info line

func (*Line) Infof

func (r *Line) Infof(format string, args ...interface{}) *Line

Infof mark this line to be just blank info line

func (*Line) Loading

func (r *Line) Loading(a ...interface{}) *Line

Loading mark this line to be loading (displays loading indicator)

func (*Line) Loadingf

func (r *Line) Loadingf(format string, args ...interface{}) *Line

Loadingf mark this line to be loading (displays loading indicator)

func (*Line) SetText

func (r *Line) SetText(a ...interface{})

SetText updates the text in the line

func (*Line) SetTextf

func (r *Line) SetTextf(format string, args ...interface{})

SetTextf updates the text according to provided format

func (*Line) Update

func (r *Line) Update()

Update triggers re-rendering

func (*Line) Warn

func (r *Line) Warn(a ...interface{}) *Line

Warn mark this line to be in warning with given message

func (*Line) Warnf

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

Warnf mark this line to be in warning with given format

func (*Line) WithProgress

func (r *Line) WithProgress(current, total int64) *Line

WithProgress display progress bar when line is in loading state

type State

type State int

State of the line

const (
	// BLANK is the default state which just displays the text
	BLANK State = iota
	// LOADING state displays loading indicator, you must call Done() or Error()
	LOADING
	// DONE represents that the task were done
	DONE
	// WARN is something should be warned
	WARN
	// ERROR is something went wrong
	ERROR
)

type Terminal

type Terminal struct {
	// contains filtered or unexported fields
}

Terminal is tracks the Lines and updates all of them when needed

func NewTerminal

func NewTerminal() *Terminal

NewTerminal creates new Terminal UI which prints output to the

func (*Terminal) NewLine

func (t *Terminal) NewLine() *Line

NewLine creates new terminal output line what you can change afterward

func (*Terminal) Start

func (t *Terminal) Start()

func (*Terminal) Stop

func (t *Terminal) Stop()

Stop updating the terminal lines

func (*Terminal) Update

func (t *Terminal) Update()

Update will re-render the output

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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