logger

package
v3.4.4-0...-e3574e9 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color func() PrintFunc

type Logger

type Logger struct {
	Stdout  io.Writer
	Stderr  io.Writer
	Verbose bool
	Color   bool
}

Logger is just a wrapper that prints stuff to STDOUT or STDERR, with optional color.

func (*Logger) Errf

func (l *Logger) Errf(color Color, s string, args ...interface{})

Errf prints stuff to STDERR.

func (*Logger) Outf

func (l *Logger) Outf(color Color, s string, args ...interface{})

Outf prints stuff to STDOUT.

func (*Logger) VerboseErrf

func (l *Logger) VerboseErrf(color Color, s string, args ...interface{})

VerboseErrf prints stuff to STDERR if verbose mode is enabled.

func (*Logger) VerboseOutf

func (l *Logger) VerboseOutf(color Color, s string, args ...interface{})

VerboseOutf prints stuff to STDOUT if verbose mode is enabled.

type PrintFunc

type PrintFunc func(io.Writer, string, ...interface{})

func Blue

func Blue() PrintFunc

func Cyan

func Cyan() PrintFunc

func Default

func Default() PrintFunc

func Green

func Green() PrintFunc

func Magenta

func Magenta() PrintFunc

func Red

func Red() PrintFunc

func Yellow

func Yellow() PrintFunc

Jump to

Keyboard shortcuts

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