conslogging

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MPL-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorMode added in v0.3.0

type ColorMode int

ColorMode is the mode in which colors are represented in the output.

const (
	// AutoColor automatically detects the presence of a TTY to decide if
	// color should be used.
	AutoColor ColorMode = iota
	// NoColor disables use of color.
	NoColor
	// ForceColor forces use of color.
	ForceColor
)

type ConsoleLogger

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

ConsoleLogger is a writer for consoles.

func Current

func Current(colorMode ColorMode) ConsoleLogger

Current returns the current console.

func (ConsoleLogger) Prefix

func (cl ConsoleLogger) Prefix() string

Prefix returns the console's prefix.

func (ConsoleLogger) PrintBytes

func (cl ConsoleLogger) PrintBytes(data []byte)

PrintBytes prints bytes directly to the console.

func (ConsoleLogger) PrintFailure added in v0.3.0

func (cl ConsoleLogger) PrintFailure()

PrintFailure prints the failure message.

func (ConsoleLogger) PrintSuccess

func (cl ConsoleLogger) PrintSuccess()

PrintSuccess prints the success message.

func (ConsoleLogger) Printf

func (cl ConsoleLogger) Printf(format string, args ...interface{})

Printf prints formatted text to the console.

func (ConsoleLogger) Warnf added in v0.2.0

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

Warnf prints a warning message in red

func (ConsoleLogger) WithCached

func (cl ConsoleLogger) WithCached(isCached bool) ConsoleLogger

WithCached returns a ConsoleLogger with isCached flag set accordingly.

func (ConsoleLogger) WithFailed added in v0.3.0

func (cl ConsoleLogger) WithFailed(isFailed bool) ConsoleLogger

WithFailed returns a ConsoleLogger with isFailed flag set accordingly.

func (ConsoleLogger) WithPrefix

func (cl ConsoleLogger) WithPrefix(prefix string) ConsoleLogger

WithPrefix returns a ConsoleLogger with a prefix added.

func (ConsoleLogger) WithPrefixAndSalt added in v0.3.0

func (cl ConsoleLogger) WithPrefixAndSalt(prefix string, salt string) ConsoleLogger

WithPrefixAndSalt returns a ConsoleLogger with a prefix and a seed added.

Jump to

Keyboard shortcuts

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