log

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

func Debugf(format string, args ...interface{})

func Errorf

func Errorf(format string, args ...interface{}) error

func Infof

func Infof(format string, args ...interface{})

func SetLogLevel added in v0.1.34

func SetLogLevel(level LogLevel)

SetLogLevel sets the logging level

func SetLogger

func SetLogger(l Logger)

func Trace

func Trace(format string, args ...interface{})

func TraceFunc

func TraceFunc(logFunc func() string)

func Tracef

func Tracef(format string, args ...interface{})

func Warnf

func Warnf(format string, args ...interface{}) error

Types

type LogLevel added in v0.1.34

type LogLevel int

LogLevel represents the logging level

const (
	// LevelError only shows errors
	LevelError LogLevel = iota
	// LevelWarn shows warnings and errors
	LevelWarn
	// LevelInfo shows info, warnings, and errors
	LevelInfo
	// LevelDebug shows debug, info, warnings, and errors
	LevelDebug
	// LevelTrace shows all log messages
	LevelTrace
)

func ParseLogLevel added in v0.1.34

func ParseLogLevel(s string) (LogLevel, error)

ParseLogLevel converts a string to a LogLevel

type Logger

type Logger struct {
	Tracef    func(format string, args ...interface{})
	Trace     func(format string)
	Infof     func(format string, args ...interface{})
	Debugf    func(format string, args ...interface{})
	Warnf     func(format string, args ...interface{}) error
	Errorf    func(format string, args ...interface{}) error
	TraceFunc func(func() string)
}

Jump to

Keyboard shortcuts

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