silent

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package silent implements a silent logger

Index

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

func (*Logger) Debugf

func (l *Logger) Debugf(string, ...interface{})

Debugf logs nothing

func (*Logger) Errorf

func (l *Logger) Errorf(string, ...interface{})

Errorf logs nothing

func (*Logger) Failf

func (l *Logger) Failf(format string, args ...interface{}) error

Failf returns a LoggedError

func (*Logger) Infof

func (l *Logger) Infof(string, ...interface{})

Infof logs nothing

func (*Logger) Printf

func (l *Logger) Printf(string, ...interface{})

Printf logs nothing

func (*Logger) SetLevel

func (l *Logger) SetLevel(log.Level)

SetLevel does nothing

func (*Logger) SetWriter

func (l *Logger) SetWriter(io.Writer)

SetWriter does nothing

func (*Logger) Warnf

func (l *Logger) Warnf(string, ...interface{})

Warnf logs nothing

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

func (p *ProgressBar) Stop()

Stop stops 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)

Jump to

Keyboard shortcuts

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