logger

package
v0.9.25 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 13

Documentation

Index

Constants

View Source
const (
	DEBUG = iota
	INFO
	ERROR
	FATAL
)

Variables

This section is empty.

Functions

func Debug

func Debug(tag string, data ...any)

func DebugLazy added in v0.7.14

func DebugLazy(tag string, dataProvider func() []any)

func Error

func Error(tag string, data ...any)

func Fatal

func Fatal(tag string, data ...any)

func GetLogger added in v0.7.14

func GetLogger(level int) *log.Logger

func Info

func Info(tag string, data ...any)

func InfoLazy added in v0.7.14

func InfoLazy(tag string, dataProvider func() []any)

func Init

func Init(level int)

func LogLevel

func LogLevel() int

func SetWriter

func SetWriter(w io.Writer)

Types

type Loggable

type Loggable interface {
	Name() string
}

type Logger

type Logger interface {
	Debug(msg ...any)
	DebugLazy(dataProvider func() []any)
	Info(msg ...any)
	InfoLazy(dataProvider func() []any)
	Error(msg ...any)
	Fatal(msg ...any)
	LogDebug(msg ...any)
	LogDebugLazy(dataProvider func() []any)
	LogInfo(msg ...any)
	LogInfoLazy(dataProvider func() []any)
	LogError(msg ...any)
	LogIfError(when string, err error)
	LogFatal(msg ...any)
}

func New

func New(loggable Loggable) Logger

func NewWithTag added in v0.8.0

func NewWithTag(tag string) Logger

Jump to

Keyboard shortcuts

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