zlog

package
v0.0.0-...-fa813a3 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: BSD-3-Clause Imports: 18 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PrintPriority = DebugLevel

	UseColor    = false
	PrintDate   = true
	EnablerList sync.Map // map[string]*Enabler

)
View Source
var SyslogName string

Functions

func AddHook

func AddHook(id string, call func(s string))

func Assert

func Assert(success bool, parts ...any)

func AssertMakeError

func AssertMakeError(success bool, parts ...any) error

func AssertNotError

func AssertNotError(err error, parts ...any)

func Debug

func Debug(parts ...any)

Debug performs Log with DebugLevel priority

func Error

func Error(parts ...any) error

func ErrorAtStack

func ErrorAtStack(stackPos int, parts ...any) error

Error performs Log with ErrorLevel priority, getting stack from N

func ErrorIf

func ErrorIf(check bool, parts ...any) bool

func Fatal

func Fatal(parts ...any) error

Fatal performs Log with Fatal priority

func FatalNotImplemented

func FatalNotImplemented()

func Full

func Full(v any) string

func Func

func Func()

func Hex

func Hex(v any) string

func Info

func Info(parts ...any)

Info performs Log with InfoLevel priority

func Infof

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

Info performs Log with InfoLevel priority

func NewError

func NewError(parts ...any) error

func NewLogError

func NewLogError(priority Priority, time time.Time, pos int, parts ...any) error

func OnError

func OnError(parts ...any) bool

func OnErrorTestError

func OnErrorTestError(t *testing.T, err error, items ...any) bool

func Pointer

func Pointer(v any) string

func PrintProfileAverages

func PrintProfileAverages(printSecs float64)

func PrintStartupInfo

func PrintStartupInfo(version, commitHash, builtAt, builtBy, builtOn string)

func RegisterEnabler

func RegisterEnabler(name string, b *Enabler)

func Verbose

func Verbose(parts ...any)

Verbose performs Log with InfoLevel priority

func Warn

func Warn(parts ...any)

Info performs Log with InfoLevel priority

Types

type Enabler

type Enabler bool

type LimitID

type LimitID string

func Limit

func Limit(parts ...any) LimitID

type Line

type Line struct {
	Text     string
	Duration time.Duration
	Time     time.Time
}

type Priority

type Priority int
const (
	VerboseLevel Priority = iota
	DebugLevel
	InfoLevel
	WarningLevel
	ErrorLevel
	FatalLevel
)

type Profile

type Profile struct {
	Name    string
	Start   time.Time
	Lines   []Line
	MinSecs float64
}

func NewProfile

func NewProfile(minSecs float64, name ...any) *Profile

func (*Profile) End

func (p *Profile) End(parts ...any)

func (*Profile) Log

func (p *Profile) Log(parts ...any)

type StackAdjust

type StackAdjust int

Jump to

Keyboard shortcuts

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