log

package
v0.0.0-...-15d240f Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultHead = []any{"Config Key", "Config Value"}
View Source
var (
	EnableDebug = false // EnableDebug will enable the disabled debug log level.

)

Functions

func Debug

func Debug(v ...any)

Debug would print the log with in debug level. The debug was disabled by default. // You should use EnableDebug to enable it.

func Debugf

func Debugf(format string, v ...any)

Debugf would print the log with in debug level. The debug was disabled by default. You should use EnableDebug to enable it.

func Exit

func Exit(err error)

Exit will print the error with fatal level and os.Exit if the error isn't nil.

func Fatal

func Fatal(v ...any)

Fatal would print the log with fatal level. And exit the program.

func Fatalf

func Fatalf(format string, v ...any)

Fatalf would print the log with fatal level. And exit the program.

func Info

func Info(v ...any)

Info would print the log with info level.

func Infof

func Infof(format string, v ...any)

Infof would print the log with info level.

func NewProgressBar

func NewProgressBar(index, total int64, filename string, bytes int64) *progressbar.ProgressBar

NewProgressBar is used to print beautiful download progress.

func Warn

func Warn(v ...any)

Warn would print the log with warn level.

func Warnf

func Warnf(format string, v ...any)

Warnf would print the log with warn level.

Types

type Printer

type Printer interface {
	Title(title string) Printer // Title adds the table title.
	Head(heads ...any) Printer  // Head adds the table head.
	Row(fields ...any) Printer  // Row add a row to the table.
	AllowZeroValue() Printer    // AllowZeroValue The row will be printed if it contains zero value.
	Print()                     // Print would print a table-like message from the given config.
}

func NewPrinter

func NewPrinter() Printer

NewPrinter will return a printer for table-like logs.

Jump to

Keyboard shortcuts

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