log

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FatalLevel = 1 << iota
	WarnLevel
	InfoLevel
	DebugLevel
	PrintLevel = 0

	PRINT = "PRINT"
	FATAL = "FATAL"
	WARN  = "WARN"
	INFO  = "INFO"
	DEBUG = "DEBUG"
)

logger level

Variables

View Source
var (
	Output    = defaultLogger.Output
	Printf    = defaultLogger.Printf
	Debugf    = defaultLogger.Debugf
	Infof     = defaultLogger.Infof
	Warnf     = defaultLogger.Warnf
	Fatalf    = defaultLogger.Fatalf
	SetLevel  = defaultLogger.SetLevel
	SetOutput = defaultLogger.SetOutput
)

Functions

func LevelInt

func LevelInt(level string) int

func LevelString

func LevelString(level int) string

func SetDefault

func SetDefault(l Logger)

Types

type Logger

type Logger interface {
	Output(callDepth int, level, format string, v ...any)
	Printf(format string, v ...any)
	Debugf(format string, v ...any)
	Infof(format string, v ...any)
	Warnf(format string, v ...any)
	Fatalf(format string, v ...any)
	SetLevel(level string)
	SetOutput(w io.Writer)
}

func Default

func Default() Logger

func Standard

func Standard() Logger

Jump to

Keyboard shortcuts

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