Documentation ¶
Overview ¶
Package silent implements a silent logger
Index ¶
- type Logger
- func (l *Logger) Debugf(string, ...interface{})
- func (l *Logger) Errorf(string, ...interface{})
- func (l *Logger) Failf(format string, args ...interface{}) error
- func (l *Logger) Infof(string, ...interface{})
- func (l *Logger) Printf(string, ...interface{})
- func (l *Logger) SetLevel(log.Level)
- func (l *Logger) SetWriter(io.Writer)
- func (l *Logger) Warnf(string, ...interface{})
- type ProgressBar
- func (p *ProgressBar) Add(int) log.ProgressBar
- func (p *ProgressBar) Errorf(string, ...interface{})
- func (p *ProgressBar) Infof(string, ...interface{})
- func (p *ProgressBar) Start(...interface{}) (log.ProgressBar, error)
- func (p *ProgressBar) Stop()
- func (p *ProgressBar) Successf(string, ...interface{})
- func (p *ProgressBar) UpdateTitle(string) log.ProgressBar
- func (p *ProgressBar) Warnf(string, ...interface{})
- func (p *ProgressBar) WithTotal(int) log.ProgressBar
- type SectionLogger
- func (l *SectionLogger) ExecuteStep(_ string, fn func() error) error
- func (l *SectionLogger) PrefixText(txt string) string
- func (l *SectionLogger) ProgressBar() log.ProgressBar
- func (l *SectionLogger) Section(_ string, fn func(log.SectionLogger) error) error
- func (l *SectionLogger) StartSection(string) log.SectionLogger
- func (l *SectionLogger) Successf(string, ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct { }
Logger defines a logger that does not log anything
func NewLogger ¶
func NewLogger() *Logger
NewLogger returns a new Logger that does not log any message
type ProgressBar ¶
type ProgressBar struct { }
ProgressBar defines a widget that supports the ProgressBar interface and does nothing
func NewProgressBar ¶
func NewProgressBar() *ProgressBar
NewProgressBar returns a new ProgressBar that does not produce any output
func (*ProgressBar) Add ¶
func (p *ProgressBar) Add(int) log.ProgressBar
Add increments the progress bar the specified amount
func (*ProgressBar) Errorf ¶
func (p *ProgressBar) Errorf(string, ...interface{})
Errorf shows an error message
func (*ProgressBar) Infof ¶
func (p *ProgressBar) Infof(string, ...interface{})
Infof shows an info message
func (*ProgressBar) Start ¶
func (p *ProgressBar) Start(...interface{}) (log.ProgressBar, error)
Start initiates the progress bar
func (*ProgressBar) Successf ¶
func (p *ProgressBar) Successf(string, ...interface{})
Successf displays a success message
func (*ProgressBar) UpdateTitle ¶
func (p *ProgressBar) UpdateTitle(string) log.ProgressBar
UpdateTitle updates the progress bar title
func (*ProgressBar) Warnf ¶
func (p *ProgressBar) Warnf(string, ...interface{})
Warnf displays a warning message
func (*ProgressBar) WithTotal ¶
func (p *ProgressBar) WithTotal(int) log.ProgressBar
WithTotal sets the progress bar total steps
type SectionLogger ¶
type SectionLogger struct {
*Logger
}
SectionLogger is a SectionLogger that does not output anything
func NewSectionLogger ¶
func NewSectionLogger() *SectionLogger
NewSectionLogger creates a new SilentSectionLogger
func (*SectionLogger) ExecuteStep ¶
func (l *SectionLogger) ExecuteStep(_ string, fn func() error) error
ExecuteStep executes a function while showing an indeterminate progress animation
func (*SectionLogger) PrefixText ¶
func (l *SectionLogger) PrefixText(txt string) string
PrefixText returns the indented version of the provided text
func (*SectionLogger) ProgressBar ¶
func (l *SectionLogger) ProgressBar() log.ProgressBar
ProgressBar returns a new silent progress bar
func (*SectionLogger) Section ¶
func (l *SectionLogger) Section(_ string, fn func(log.SectionLogger) error) error
Section executes the provided function inside a new section
func (*SectionLogger) StartSection ¶
func (l *SectionLogger) StartSection(string) log.SectionLogger
StartSection starts a new log section
func (*SectionLogger) Successf ¶
func (l *SectionLogger) Successf(string, ...interface{})
Successf logs a new success message (more efusive than Infof)