log

package
Version: v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package log contains logging related functionality

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Askf

func Askf(format string, a ...interface{})

Askf will print out information, but in an "Ask" way (without newline)

func Describef added in v1.0.0

func Describef(title string, format string, a ...interface{})

Describef will print out the first variable as BOLD and then the second not.. this is intended to be used with `odo describe` and other outputs that list a lot of information

func Error

func Error(a ...interface{})

Error will output in an appropriate "progress" manner

func Errorf

func Errorf(format string, a ...interface{})

Errorf will output in an appropriate "progress" manner

func Experimental added in v1.1.2

func Experimental(a ...interface{})

Experimental will output in an appropriate "progress" manner

func GetStderr added in v1.0.0

func GetStderr() io.Writer

GetStderr gets the appropriate stderrfrom the OS. If it's Linux, it will use the go-colorable library in order to fix any and all color ASCII issues. TODO: Test needs to be added once we get Windows testing available on TravisCI / CI platform.

func GetStdout added in v1.0.0

func GetStdout() io.Writer

GetStdout gets the appropriate stdout from the OS. If it's Linux, it will use the go-colorable library in order to fix any and all color ASCII issues. TODO: Test needs to be added once we get Windows testing available on TravisCI / CI platform.

func Info

func Info(a ...interface{})

Info will simply print out information on a new (bolded) line this is intended as information *after* something has been deployed

func Infof

func Infof(format string, a ...interface{})

Infof will simply print out information on a new (bolded) line this is intended as information *after* something has been deployed

func IsDebug

func IsDebug() bool

IsDebug returns true if we are debugging (-v is set to anything but 0)

func IsJSON added in v1.0.0

func IsJSON() bool

IsJSON returns true if we are in machine output mode.. under NO circumstances should we output any logging.. as we are only outputting json

func IsTerminal

func IsTerminal(w io.Writer) bool

IsTerminal returns true if the writer w is a terminal This function is modified if we are running within Windows.. as Golang's built-in "IsTerminal" command only works on UNIX-based systems: https://github.com/golang/crypto/blob/master/ssh/terminal/util.go#L5

func Italic added in v1.0.0

func Italic(a ...interface{})

Italic will simply print out information on a new italic line

func Italicf added in v1.0.2

func Italicf(format string, a ...interface{})

Italicf will simply print out information on a new italic line this is **normally** used as a way to describe what's next within odo.

func Namef

func Namef(format string, a ...interface{})

Namef will output the name of the component / application / project in a *bolded* manner

func Progressf

func Progressf(format string, a ...interface{})

Progressf will output in an appropriate "progress" manner

func Success added in v1.0.0

func Success(a ...interface{})

Success will output in an appropriate "success" manner

func Successf

func Successf(format string, a ...interface{})

Successf will output in an appropriate "progress" manner

func Swarningf added in v1.1.2

func Swarningf(format string, a ...interface{}) string

Swarningf (like Sprintf) will return a string in the "warning" manner

func Warning added in v1.0.0

func Warning(a ...interface{})

Warning will output in an appropriate "progress" manner

func Warningf added in v1.0.0

func Warningf(format string, a ...interface{})

Warningf will output in an appropriate "warning" manner

Types

type Status

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

Status is used to track ongoing status in a CLI, with a nice loading spinner when attached to a terminal

func ExplicitSpinner added in v1.2.6

func ExplicitSpinner(status string, preventSpinning bool) *Status

ExplicitSpinner creates a spinner that can or not spin based on the value of the preventSpinning parameter

func NewStatus

func NewStatus(w io.Writer) *Status

NewStatus creates a new default Status

func Spinner

func Spinner(status string) *Status

Spinner creates a spinner, sets the prefix then returns it. Remember to use .End(bool) to stop the spin / when you're done. For example: defer s.End(false)

func SpinnerNoSpin added in v1.0.0

func SpinnerNoSpin(status string) *Status

SpinnerNoSpin is the same as the "Spinner" function but forces no spinning

func Spinnerf

func Spinnerf(format string, a ...interface{}) *Status

Spinnerf creates a spinner, sets the prefix then returns it. Remember to use .End(bool) to stop the spin / when you're done. For example: defer s.End(false) for situations where spinning isn't viable (debug)

func (*Status) End

func (s *Status) End(success bool)

End completes the current status, ending any previous spinning and marking the status as success or failure

func (*Status) Start

func (s *Status) Start(status string, debug bool)

Start starts a new phase of the status, if attached to a terminal there will be a loading spinner with this status

func (*Status) WarningStatus added in v1.1.2

func (s *Status) WarningStatus(status string)

WarningStatus puts a warning status within the spinner and then updates the current status

Source Files

Directories

Path Synopsis
Package fidget implements CLI functionality for bored users waiting for results
Package fidget implements CLI functionality for bored users waiting for results

Jump to

Keyboard shortcuts

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