Documentation
¶
Overview ¶
Package logger provides logging services
Index ¶
- func CleanLine()
- func Error(v ...any)
- func Fatal(v ...any)
- func GetLoggerWriter() io.Writer
- func Info(v ...any)
- func InfoB(v ...any)
- func InfoBB(v ...any)
- func InfoBC(v ...any)
- func InfoBG(v ...any)
- func InfoBM(v ...any)
- func InfoBR(v ...any)
- func InfoBW(v ...any)
- func InfoBY(v ...any)
- func InfoC(v ...any)
- func InfoG(v ...any)
- func InfoM(v ...any)
- func InfoR(v ...any)
- func InfoTable(v ...any)
- func InfoW(v ...any)
- func InfoY(v ...any)
- func IsTerminal() bool
- func LogTimerOn() bool
- func Panic(v ...any)
- func PctProgress(done int32, total int, tick int32)
- func Progress(tick bool, v ...any)
- func SetLoggerWriter(w io.Writer)
- func SetTestMode(onOff bool)
- func TestLog(notDefault bool, a ...interface{})
- func ToggleDecoration()
- func Warn(v ...any)
- type BarOptions
- type BarType
- type ProgressBar
- type Timer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLoggerWriter ¶
func IsTerminal ¶
func IsTerminal() bool
func LogTimerOn ¶
func LogTimerOn() bool
func PctProgress ¶
func SetLoggerWriter ¶
SetLoggerWriter sets the writer to which log messages are written. Do not send nil as a writer if you wish to disable logging. Instead, use
w := logger.GetLoggerWriter() defer logger.SetLoggerWriter(w) logger.SetLoggerWriter(io.Discard)
Setting to `nil` will core dump.
func SetTestMode ¶
func SetTestMode(onOff bool)
func TestLog ¶
func TestLog(notDefault bool, a ...interface{})
TestLog is used to print log lines during testing only
func ToggleDecoration ¶
func ToggleDecoration()
Types ¶
type BarOptions ¶
type BarOptions struct { Enabled bool // enable progress bar Type BarType // if Expanding, the bar doesn't know how many object there will be, so grows Prefix string // the string to display first Fill string // the fill value for progress bar Start int64 // the starting value (defaults to zero) Total int64 // the total (possibly estimated for Expanding) number of objects PrefixColor string // the color of the prefix }
type ProgressBar ¶
type ProgressBar struct { BarOptions // contains filtered or unexported fields }
func NewBar ¶
func NewBar(opts BarOptions) (bar *ProgressBar)
func (*ProgressBar) Bump ¶
func (bar *ProgressBar) Bump()
func (*ProgressBar) Tick ¶
func (bar *ProgressBar) Tick()
Click to show internal directories.
Click to hide internal directories.