feedback

package
v0.0.0-...-d3cc92b Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const FeedbackPkg = Package("feedback")

Variables

This section is empty.

Functions

func Debug

func Debug(pkg Package, msgFormat string, msgArgs ...any)

func Disable

func Disable()

func DisableLog

func DisableLog(pkg Package)

func Enable

func Enable(receiver FeedbackReceiver)

func Error

func Error(pkg Package, msgFormat string, msgArgs ...any)

func Fatal

func Fatal(pkg Package, msgFormat string, msgArgs ...any)

func Info

func Info(pkg Package, msgFormat string, msgArgs ...any)

func InterceptProgress

func InterceptProgress(target Package, progressCallback ProgressCallback)

func Log

func Log(pkg Package, severity Severity, msgFormat string, msgArgs ...any)

func Progress

func Progress(pkg Package, process, message string, current, total int64, unit cli.Unit)

func Reenable

func Reenable()

func ReenableLog

func ReenableLog(pkg Package)

func UninterceptProgress

func UninterceptProgress(target Package)

func Warn

func Warn(pkg Package, msgFormat string, msgArgs ...any)

Types

type CLIFeedback

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

func NewCLIFeedback

func NewCLIFeedback(minSeverity Severity) *CLIFeedback

func (*CLIFeedback) Log

func (c *CLIFeedback) Log(pkg Package, severity Severity, message string)

func (*CLIFeedback) Progress

func (c *CLIFeedback) Progress(pkg Package, process, message string, current, total int64, unit cli.Unit)

type FeedbackReceiver

type FeedbackReceiver interface {
	Log(pkg Package, severity Severity, message string)
	Progress(pkg Package, process, message string, current, total int64, unit cli.Unit)
}

type Package

type Package string

type ProgressCallback

type ProgressCallback func(pkg Package, key, message string, current, total int64, unit cli.Unit)

type Severity

type Severity int
const (
	SeverityDebug Severity = iota
	SeverityInfo
	SeverityWarn
	SeverityError
	SeverityFatal
	SeverityNone
)

Jump to

Keyboard shortcuts

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