zlog

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Err

func Err(err error, msg string)

Err 打印错误级别日志

func ErrForErrCheck

func ErrForErrCheck(err error, msg string)

ErrForErrCheck 打印错误级别日志

func ErrWithStr

func ErrWithStr(err error) *zerolog.Event

ErrWithStr 可自定义添加字段和描述

func ErrWithStrForErrCheck

func ErrWithStrForErrCheck(err error) *zerolog.Event

ErrWithStrForErrCheck 可自定义添加字段和描述

func Info

func Info(msg string)

func InfoWithStr

func InfoWithStr() *zerolog.Event

func InitLog

func InitLog(srcName, dir string, stdType, level int) (err error)

func Warn

func Warn(msg string)

func WarnWithStr

func WarnWithStr() *zerolog.Event

Types

type Level

type Level int
const (
	// DebugLevel defines debug log level.
	DebugLevel Level = iota
	// InfoLevel defines info log level.
	InfoLevel
	// WarnLevel defines warn log level.
	WarnLevel
	// ErrorLevel defines error log level.
	ErrorLevel
	// FatalLevel defines fatal log level.
	FatalLevel
	// PanicLevel defines panic log level.
	PanicLevel
	// NoLevel defines an absent log level.
	NoLevel
	// Disabled disables the logger.
	Disabled

	// TraceLevel defines trace log level.
	TraceLevel Level = -1

	// LogInfoSuffix 日志前缀
	LogInfoSuffix = ".info.log"
	LogErrSuffix  = ".error.log"
	LogWarnSuffix = ".warn.log"
	LogGinAccess  = ".ginAccess.log"
)

type LogT

type LogT struct {
	// contains filtered or unexported fields
}

LogT :

Jump to

Keyboard shortcuts

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