logger

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

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

func (*Log) Debugf

func (l *Log) Debugf(format string, a ...interface{})

func (*Log) Debugln

func (l *Log) Debugln(a ...interface{})

func (*Log) Errorf

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

func (*Log) Errorln

func (l *Log) Errorln(a ...interface{})

func (*Log) Infof

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

func (*Log) Infoln

func (l *Log) Infoln(a ...interface{})

func (*Log) Level

func (l *Log) Level() LogLevel

func (*Log) Printf

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

func (*Log) Println

func (l *Log) Println(a ...interface{})

func (*Log) Printo

func (l *Log) Printo(a ...interface{})

func (*Log) ProgressBar

func (l *Log) ProgressBar() ProgressbarPrinter

func (*Log) Section added in v0.1.2

func (l *Log) Section() *pterm.SectionPrinter

func (*Log) SetLevel

func (l *Log) SetLevel(logLevel string) error

func (*Log) Spinner

func (l *Log) Spinner() pterm.SpinnerPrinter

func (*Log) Successf

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

func (*Log) Successln

func (l *Log) Successln(a ...interface{})

func (*Log) Table

func (l *Log) Table() pterm.TablePrinter

func (*Log) Warnf

func (l *Log) Warnf(format string, a ...interface{})

func (*Log) Warnln

func (l *Log) Warnln(a ...interface{})

type LogLevel

type LogLevel int
const (
	LogLevelDebug LogLevel = iota
	LogLevelInfo
	LogLevelWarn
	LogLevelError
)

type Logger

type Logger interface {
	Printf(format string, a ...interface{})
	Println(a ...interface{})
	Printo(a ...interface{})

	Debugf(format string, a ...interface{})
	Debugln(a ...interface{})
	Infof(format string, a ...interface{})
	Infoln(a ...interface{})
	Successf(format string, a ...interface{})
	Successln(a ...interface{})
	Warnf(format string, a ...interface{})
	Warnln(a ...interface{})
	Errorf(format string, a ...interface{})
	Errorln(a ...interface{})

	Level() LogLevel
	SetLevel(logLevel string) error

	Spinner() pterm.SpinnerPrinter
	Table() pterm.TablePrinter
	Section() *pterm.SectionPrinter
	ProgressBar() ProgressbarPrinter
}

func NewLogger

func NewLogger() Logger

type ProgressbarPrinter added in v0.1.2

type ProgressbarPrinter struct {
	*pterm.ProgressbarPrinter
	// contains filtered or unexported fields
}

func (*ProgressbarPrinter) Add added in v0.1.2

func (p *ProgressbarPrinter) Add(count int)

Add to current value.

func (*ProgressbarPrinter) Increment added in v0.1.2

func (p *ProgressbarPrinter) Increment()

Increment current value by one.

func (*ProgressbarPrinter) Start added in v0.1.2

func (*ProgressbarPrinter) UpdateTitle added in v0.1.2

func (p *ProgressbarPrinter) UpdateTitle(title string)

Add to current value.

func (ProgressbarPrinter) WithBarCharacter added in v0.1.2

func (p ProgressbarPrinter) WithBarCharacter(char string) *ProgressbarPrinter

WithBarCharacter sets the bar character of the ProgressbarPrinter.

func (ProgressbarPrinter) WithBarStyle added in v0.1.2

func (p ProgressbarPrinter) WithBarStyle(style *pterm.Style) *ProgressbarPrinter

WithBarStyle sets the style of the bar.

func (ProgressbarPrinter) WithCurrent added in v0.1.2

func (p ProgressbarPrinter) WithCurrent(current int) *ProgressbarPrinter

WithCurrent sets the current value of the ProgressbarPrinter.

func (ProgressbarPrinter) WithElapsedTimeRoundingFactor added in v0.1.2

func (p ProgressbarPrinter) WithElapsedTimeRoundingFactor(duration time.Duration) *ProgressbarPrinter

WithElapsedTimeRoundingFactor sets the rounding factor of the elapsed time.

func (ProgressbarPrinter) WithLastCharacter added in v0.1.2

func (p ProgressbarPrinter) WithLastCharacter(char string) *ProgressbarPrinter

WithLastCharacter sets the last character of the ProgressbarPrinter.

func (ProgressbarPrinter) WithRemoveWhenDone added in v0.1.2

func (p ProgressbarPrinter) WithRemoveWhenDone(b ...bool) *ProgressbarPrinter

WithRemoveWhenDone sets if the ProgressbarPrinter should be removed when it is done.

func (ProgressbarPrinter) WithShowCount added in v0.1.2

func (p ProgressbarPrinter) WithShowCount(b ...bool) *ProgressbarPrinter

WithShowCount sets if the total and current count should be displayed in the ProgressbarPrinter.

func (ProgressbarPrinter) WithShowElapsedTime added in v0.1.2

func (p ProgressbarPrinter) WithShowElapsedTime(b ...bool) *ProgressbarPrinter

WithShowElapsedTime sets if the elapsed time should be displayed in the ProgressbarPrinter.

func (ProgressbarPrinter) WithShowPercentage added in v0.1.2

func (p ProgressbarPrinter) WithShowPercentage(b ...bool) *ProgressbarPrinter

WithShowPercentage sets if the completed percentage should be displayed in the ProgressbarPrinter.

func (ProgressbarPrinter) WithShowTitle added in v0.1.2

func (p ProgressbarPrinter) WithShowTitle(b ...bool) *ProgressbarPrinter

WithShowTitle sets if the title should be displayed in the ProgressbarPrinter.

func (ProgressbarPrinter) WithTitle added in v0.1.2

func (p ProgressbarPrinter) WithTitle(name string) *ProgressbarPrinter

WithTitle sets the name of the ProgressbarPrinter.

func (ProgressbarPrinter) WithTitleStyle added in v0.1.2

func (p ProgressbarPrinter) WithTitleStyle(style *pterm.Style) *ProgressbarPrinter

WithTitleStyle sets the style of the title.

func (ProgressbarPrinter) WithTotal added in v0.1.2

func (p ProgressbarPrinter) WithTotal(total int) *ProgressbarPrinter

// WithTotal sets the total value of the ProgressbarPrinter.

Jump to

Keyboard shortcuts

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