elog

package
v0.0.0-...-79a645e Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MultiWriteSeeker

func MultiWriteSeeker(writeseekers ...io.WriteSeeker) io.WriteSeeker

MultiWriteSeeker returns a MultiWriteSeeker object

Types

type CLI

type CLI struct {
	DisableColors bool
	DisableTTY    bool
	IsDebug       bool
	IsVerbose     bool
	// contains filtered or unexported fields
}

CLI is a generic object setup for logging to terminal outputs

func (*CLI) Debugf

func (log *CLI) Debugf(format string, x ...interface{})

Debugf is a wrapper function that executes logrus.Tracef if debug is enabled.

func (*CLI) Errorf

func (log *CLI) Errorf(format string, x ...interface{})

Errorf is a wrapper function that executes logrus.Errorf

func (*CLI) Format

func (log *CLI) Format(entry *logrus.Entry) ([]byte, error)

Format formats our logger for terminal use

func (*CLI) Infof

func (log *CLI) Infof(format string, x ...interface{})

Infof is a wrapper function that executes logrus.Debugf only if verbose is enabled.

func (*CLI) IsDebugEnabled

func (log *CLI) IsDebugEnabled() bool

IsDebugEnabled returns whether DebugLevel logging is enabled

func (*CLI) IsInfoEnabled

func (log *CLI) IsInfoEnabled() bool

IsInfoEnabled returns whether InfoLevel logging is enabled

func (*CLI) NewProgress

func (log *CLI) NewProgress(label string, units string, total int64) Progress

NewProgress creates a progress object and returns

func (*CLI) Printf

func (log *CLI) Printf(format string, x ...interface{})

Printf is a wrapper function that executes logrus.Printf

func (*CLI) Warnf

func (log *CLI) Warnf(format string, x ...interface{})

Warnf is a wrapper function that executes logrus.Warnf

type Logger

type Logger interface {
	Debugf(format string, x ...interface{})
	Errorf(format string, x ...interface{})
	Infof(format string, x ...interface{})
	Printf(format string, x ...interface{})
	Warnf(format string, x ...interface{})
	IsInfoEnabled() bool
	IsDebugEnabled() bool
}

Logger is an interface that has the ability to hide debug/info

type Progress

type Progress interface {
	Finish(success bool)
	Increment(n int64)
	Write(p []byte) (n int, err error)
	Seek(offset int64, whence int) (int64, error)
	ProxyReader(r io.Reader) io.ReadCloser
}

Progress is an interface to display progress bars for certain operations

type ProgressReporter

type ProgressReporter interface {
	NewProgress(label string, units string, total int64) Progress
}

ProgressReporter is an interface that contains the ability to create a Progress bar object.

type View

type View interface {
	Logger
	ProgressReporter
}

View is an interface that contains a logger and the ability to create progress objects

Jump to

Keyboard shortcuts

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