logs

package
v3.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogFilePath string

Functions

func CreateLog

func CreateLog(logPath string)

func Debug

func Debug(v ...any)

func Debugf

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

func Error

func Error(v ...any)

func Errorf

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

func Info

func Info(v ...any)

func Infof

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

func Recover

func Recover()

func RegisterOut

func RegisterOut(outFunc func(level Level, format string, v ...any))

RegisterOut 注册日志输出格式

func SetLogConfig

func SetLogConfig(fn func(n *LogConfig))

func Trace

func Trace(v ...any)

func Tracef

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

func Warn

func Warn(v ...any)

func Warnf

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

Types

type Level

type Level int8
const (
	TRACE Level = iota
	DEBUG
	INFO
	WARN
	ERROR
)

type LogConfig

type LogConfig struct {
	Trace bool `json:"trace"`
	Debug bool `json:"debug"`
	Info  bool `json:"info"`
	Warn  bool `json:"warn"`
	Error bool `json:"error"`
}

Jump to

Keyboard shortcuts

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