logger

package
v0.0.0-...-3f8eaf4 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-3.0 Imports: 9 Imported by: 18

Documentation

Overview

Package logger provides logging services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanLine

func CleanLine()

func Error

func Error(v ...any)

func Fatal

func Fatal(v ...any)

func Info

func Info(v ...any)

func InfoTable

func InfoTable(v ...any)

func LogTimerOn

func LogTimerOn() bool

func Panic

func Panic(v ...any)

func PctProgress

func PctProgress(done int32, total int, tick int32)

func Progress

func Progress(tick bool, v ...any)

func TestLog

func TestLog(notDefault bool, a ...interface{})

TestLog is used to print log lines during testing only

func ToggleDecoration

func ToggleDecoration()

func Warn

func Warn(v ...any)

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 BarType

type BarType int
const (
	Fixed BarType = iota
	Expanding
)

type ProgressBar

type ProgressBar struct {
	BarOptions
	// contains filtered or unexported fields
}

func NewBar

func NewBar(opts BarOptions) (bar *ProgressBar)

func (*ProgressBar) Finish

func (bar *ProgressBar) Finish(newLine bool) time.Duration

func (*ProgressBar) Tick

func (bar *ProgressBar) Tick()

type Timer

type Timer struct {
	// contains filtered or unexported fields
}

func NewTimer

func NewTimer() Timer

func (*Timer) Level

func (t *Timer) Level(l int)

func (*Timer) LevelDown

func (t *Timer) LevelDown()

func (*Timer) LevelUp

func (t *Timer) LevelUp()

func (*Timer) Report

func (t *Timer) Report(msg string)

Jump to

Keyboard shortcuts

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