logger

package
v0.1.42 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2021 License: MIT Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func (*Log) SetLevelString added in v0.1.23

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

func (*Log) Spinner

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

func (*Log) StderrPrintf added in v0.1.12

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

func (*Log) StderrPrintln added in v0.1.12

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

func (*Log) StderrPrinto added in v0.1.12

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

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{})
	StderrPrintf(format string, a ...interface{})
	StderrPrintln(a ...interface{})
	StderrPrinto(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 LogLevel)
	SetLevelString(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