logger

package
v0.1.143 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 11 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) Debug added in v0.1.75

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

func (*Log) Debugf

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

func (*Log) Debugln

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

func (*Log) Error added in v0.1.75

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

func (*Log) Errorf

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

func (*Log) Errorln

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

func (*Log) Info added in v0.1.75

func (l *Log) Info(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) Notice added in v0.1.105

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

func (*Log) Noticef added in v0.1.105

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

func (*Log) Noticeln added in v0.1.105

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

func (*Log) Print added in v0.1.45

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

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() Progressbar

func (*Log) Section added in v0.1.2

func (l *Log) Section() Section

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() Spinner

func (*Log) Success added in v0.1.75

func (l *Log) Success(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() Table

func (*Log) Warn added in v0.1.75

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

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
	LogLevelNotice
	LogLevelInfo
	LogLevelWarn
	LogLevelError
)

type Logger

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

	Debugf(format string, a ...interface{})
	Debugln(a ...interface{})
	Debug(a ...interface{})
	Noticef(format string, a ...interface{})
	Noticeln(a ...interface{})
	Notice(a ...interface{})
	Infof(format string, a ...interface{})
	Infoln(a ...interface{})
	Info(a ...interface{})
	Successf(format string, a ...interface{})
	Successln(a ...interface{})
	Success(a ...interface{})
	Warnf(format string, a ...interface{})
	Warnln(a ...interface{})
	Warn(a ...interface{})
	Errorf(format string, a ...interface{})
	Errorln(a ...interface{})
	Error(a ...interface{})

	Level() LogLevel
	SetLevel(logLevel LogLevel)
	SetLevelString(logLevel string) error

	Spinner() Spinner
	Table() Table
	Section() Section
	ProgressBar() Progressbar
}

func NewLogger

func NewLogger() Logger

type PrefixPrinter added in v0.1.45

type PrefixPrinter struct {
	*pterm.PrefixPrinter
}

func (*PrefixPrinter) Printf added in v0.1.45

func (p *PrefixPrinter) Printf(format string, a ...interface{})

func (*PrefixPrinter) Println added in v0.1.45

func (p *PrefixPrinter) Println(a ...interface{})

type Progressbar added in v0.1.45

type Progressbar interface {
	WithTitle(name string) Progressbar
	WithTotal(total int) Progressbar
	WithCurrent(current int) Progressbar
	WithBarCharacter(char string) Progressbar
	WithLastCharacter(char string) Progressbar
	WithElapsedTimeRoundingFactor(duration time.Duration) Progressbar
	WithShowElapsedTime(b ...bool) Progressbar
	WithShowCount(b ...bool) Progressbar
	WithShowTitle(b ...bool) Progressbar
	WithShowPercentage(b ...bool) Progressbar
	WithTitleStyle(style *pterm.Style) Progressbar
	WithBarStyle(style *pterm.Style) Progressbar
	WithRemoveWhenDone(b ...bool) Progressbar

	Increment()
	Add(count int)
	UpdateTitle(title string)
	Start() (Progressbar, error)
	Stop()
}

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 (p *ProgressbarPrinter) Start() (Progressbar, error)

func (*ProgressbarPrinter) Stop added in v0.1.45

func (p *ProgressbarPrinter) Stop()

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

WithBarCharacter sets the bar character of the ProgressbarPrinter.

func (*ProgressbarPrinter) WithBarStyle added in v0.1.2

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

WithBarStyle sets the style of the bar.

func (*ProgressbarPrinter) WithCurrent added in v0.1.2

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

WithCurrent sets the current value of the ProgressbarPrinter.

func (*ProgressbarPrinter) WithElapsedTimeRoundingFactor added in v0.1.2

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

WithElapsedTimeRoundingFactor sets the rounding factor of the elapsed time.

func (*ProgressbarPrinter) WithLastCharacter added in v0.1.2

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

WithLastCharacter sets the last character of the ProgressbarPrinter.

func (*ProgressbarPrinter) WithRemoveWhenDone added in v0.1.2

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

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

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

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

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

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

WithTitle sets the name of the ProgressbarPrinter.

func (*ProgressbarPrinter) WithTitleStyle added in v0.1.2

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

WithTitleStyle sets the style of the title.

func (*ProgressbarPrinter) WithTotal added in v0.1.2

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

WithTotal sets the total value of the ProgressbarPrinter.

type Section added in v0.1.45

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

type SectionPrinter added in v0.1.45

type SectionPrinter struct {
	pterm.SectionPrinter
}

func (*SectionPrinter) Printf added in v0.1.45

func (p *SectionPrinter) Printf(format string, a ...interface{})

func (*SectionPrinter) Println added in v0.1.45

func (p *SectionPrinter) Println(a ...interface{})

type Spinner added in v0.1.45

type Spinner interface {
	Start(text ...interface{}) (Spinner, error)
	Stop()
}

type SpinnerPrinter added in v0.1.45

type SpinnerPrinter struct {
	*pterm.SpinnerPrinter
}

func (*SpinnerPrinter) Start added in v0.1.45

func (s *SpinnerPrinter) Start(text ...interface{}) (Spinner, error)

func (*SpinnerPrinter) Stop added in v0.1.45

func (s *SpinnerPrinter) Stop()

type Table added in v0.1.45

type Table interface {
	WithHasHeader(b ...bool) Table
	WithData(data [][]string) Table
	Srender() (string, error)
	Render() error
}

type TablePrinter added in v0.1.45

type TablePrinter struct {
	*pterm.TablePrinter
}

func (*TablePrinter) Render added in v0.1.45

func (p *TablePrinter) Render() error

func (*TablePrinter) Srender added in v0.1.45

func (p *TablePrinter) Srender() (string, error)

func (*TablePrinter) WithData added in v0.1.45

func (p *TablePrinter) WithData(data [][]string) Table

func (*TablePrinter) WithHasHeader added in v0.1.45

func (p *TablePrinter) WithHasHeader(b ...bool) Table

Jump to

Keyboard shortcuts

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