...

Package log

Overview ▾

Package log contains logging related functionality

Index ▾

func Bold(s string)
func ColorPicker() color.Attribute
func Deprecate(what, nextAction string)
func Describef(title string, format string, a ...interface{})
func DisplayExperimentalWarning()
func Error(a ...interface{})
func Errorf(format string, a ...interface{})
func Ferror(w io.Writer, a ...interface{})
func Ferrorf(w io.Writer, format string, a ...interface{})
func Finfof(w io.Writer, format string, a ...interface{})
func Fprintf(w io.Writer, format string, a ...interface{})
func Fprintln(w io.Writer)
func Fsuccess(out io.Writer, a ...interface{})
func Fwarning(out io.Writer, a ...interface{})
func Fwarningf(w io.Writer, format string, a ...interface{})
func GetStderr() io.Writer
func GetStdout() io.Writer
func Info(a ...interface{})
func Infof(format string, a ...interface{})
func IsAppleSilicon() bool
func IsDebug() bool
func IsJSON() bool
func IsTerminal(w io.Writer) bool
func Printf(format string, a ...interface{})
func Println()
func Sbold(s string) string
func SboldColor(c color.Attribute, s string) string
func Section(a ...interface{})
func Sectionf(format string, a ...interface{})
func Stitle(firstLine, secondLine string) string
func StitleWithVersion(firstLine, secondLine, versionLine string) string
func Success(a ...interface{})
func Successf(format string, a ...interface{})
func Title(firstLine, secondLine string)
func Warning(a ...interface{})
func Warningf(format string, a ...interface{})
type Status
    func ExplicitSpinner(status string, preventSpinning bool) *Status
    func Fspinnerf(w io.Writer, format string, a ...interface{}) *Status
    func NewStatus(w io.Writer) *Status
    func Spinner(status string) *Status
    func SpinnerNoSpin(status string) *Status
    func Spinnerf(format string, a ...interface{}) *Status
    func (s *Status) End(success bool)
    func (s *Status) EndWithStatus(status string, success bool)
    func (s *Status) Start(status string, debug bool)
    func (s *Status) WarningStatus(status string)

Package files

status.go

func Bold

func Bold(s string)

Bold will print out a bolded string

func ColorPicker

func ColorPicker() color.Attribute

ColorPicker picks a color from colors slice defined at the starting of this file It increments the colorCounter variable so that next iteration returns a different color

func Deprecate

func Deprecate(what, nextAction string)

Deprecate will output a warning symbol and then "Deprecated" at the end of the output in YELLOW

⚠ <message all yellow>

func Describef

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 DisplayExperimentalWarning

func DisplayExperimentalWarning()

DisplayExperimentalWarning displays the experimental mode warning message.

func Error

func Error(a ...interface{})

Error will output in an appropriate "progress" manner ✗ <message>

func Errorf

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

Errorf will output in an appropriate "progress" manner ✗ <message>

func Ferror

func Ferror(w io.Writer, a ...interface{})

Frror will output in an appropriate "progress" manner ✗ <message>

func Ferrorf

func Ferrorf(w io.Writer, format string, a ...interface{})

Ferrorf will output in an appropriate "progress" manner ✗ <message>

func Finfof

func Finfof(w io.Writer, format string, a ...interface{})

Finfof will simply print out information on a new (bolded) line this is intended as information *after* something has been deployed This will also use a WRITER input We will have to manually check to see if it's Windows platform or not to determine if we are allowed to bold the output or not. **Line in bold**

func Fprintf

func Fprintf(w io.Writer, format string, a ...interface{})

Fprintf will output in an appropriate "information" manner; for e.g. • <message>

func Fprintln

func Fprintln(w io.Writer)

Fprintln will output a new line when applicable

func Fsuccess

func Fsuccess(out io.Writer, a ...interface{})

Fsuccess will output in an appropriate "progress" manner in out writer

✓ <message>

func Fwarning

func Fwarning(out io.Writer, a ...interface{})

Fwarning will output in an appropriate "progress" manner in out writer

⚠ <message>

func Fwarningf

func Fwarningf(w io.Writer, format string, a ...interface{})

Fwarningf will output in an appropriate "warning" manner

⚠ <message>

func GetStderr

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

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 **Line in bold**

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 **Line in bold**

func IsAppleSilicon

func IsAppleSilicon() bool

IsAppleSilicon returns true if we are on a Mac M1 / Apple Silicon natively

func IsDebug

func IsDebug() bool

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

func IsJSON

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 Printf

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

Printf will output in an appropriate "information" manner; for e.g. • <message>

func Println

func Println()

Println will output a new line when applicable

func Sbold

func Sbold(s string) string

Sbold will return a bold string

func SboldColor

func SboldColor(c color.Attribute, s string) string

BoldColor will print out a bolded string with a color (that's passed in)

func Section

func Section(a ...interface{})

Section outputs a title in BLUE and underlined for separating a section (such as building a container, deploying files, etc.) T͟h͟i͟s͟ ͟i͟s͟ ͟u͟n͟d͟e͟r͟l͟i͟n͟e͟d͟ ͟b͟l͟u͟e͟ ͟t͟e͟x͟t͟

func Sectionf

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

Sectionf outputs a title in BLUE and underlined for separating a section (such as building a container, deploying files, etc.) T͟h͟i͟s͟ ͟i͟s͟ ͟u͟n͟d͟e͟r͟l͟i͟n͟e͟d͟ ͟b͟l͟u͟e͟ ͟t͟e͟x͟t͟

func Stitle

func Stitle(firstLine, secondLine string) string

Stitle is the same as Title but returns the string instead

func StitleWithVersion

func StitleWithVersion(firstLine, secondLine, versionLine string) string

StitleWithVersion is the same as Stitle, but it allows to customize the version message line

func Success

func Success(a ...interface{})

Success will output in an appropriate "success" manner ✓ <message>

func Successf

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

Successf will output in an appropriate "progress" manner

✓  <message>

func Title

func Title(firstLine, secondLine string)

Title Prints the logo as well as the first line being BLUE (indicator of the command information); the second line is optional and provides information in regard to what is being run. The last line displays information about the current odo version.

 __
/  \__     **First line**
\__/  \    Second line
/  \__/    odo version: <VERSION>
\__/

func Warning

func Warning(a ...interface{})

Warning will output in an appropriate "progress" manner

⚠ <message>

func Warningf

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

Warningf will output in an appropriate "warning" manner

⚠ <message>

type Status

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

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

func ExplicitSpinner

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 Fspinnerf

func Fspinnerf(w io.Writer, format string, a ...interface{}) *Status

Fspinnerf 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 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

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) EndWithStatus

func (s *Status) EndWithStatus(status string, success bool)

EndWithStatus is similar to End, but lets the user specify a custom message/status while ending

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

func (s *Status) WarningStatus(status string)

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

Subdirectories

Name Synopsis
..
fidget Package fidget implements CLI functionality for bored users waiting for results