blog

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugLevel = zap.DebugLevel
	InfoLevel  = zap.InfoLevel
	WarnLevel  = zap.WarnLevel
	ErrLevel   = zap.ErrorLevel
)

Variables

View Source
var (
	DefaultConfig = Parm{
		// contains filtered or unexported fields
	}
)
View Source
var (

	// ErrConfigConvert 配置转换失败
	ErrConfigConvert = errors.New("convert linker config")
)

Functions

func Close

func Close()

Close 清理日志,并将缓存中的日志刷新到文件

Types

type Logger

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

Logger logger struct

func BuildWithDefaultOption

func BuildWithDefaultOption() *Logger

func BuildWithOption

func BuildWithOption(opts ...Option) *Logger

func (*Logger) Debugf

func (l *Logger) Debugf(msg string, args ...interface{})

Debugf debug级别诊断日志

func (*Logger) Errf

func (l *Logger) Errf(msg string, args ...interface{})

func (*Logger) Infof

func (l *Logger) Infof(msg string, args ...interface{})

func (*Logger) Warnf

func (l *Logger) Warnf(msg string, args ...interface{})

type Option

type Option func(*Parm)

Option config wraps

func WithBackups

func WithBackups(backupday int) Option

WithBackups 最多保存的备份文件数

func WithCompress

func WithCompress(compress bool) Option

WithCompress 是否压缩

func WithLevel

func WithLevel(loglv int) Option

WithLevel 日志等级

func WithMaxAge

func WithMaxAge(age int) Option

WithMaxAge 最大备份天数

func WithMaxSize

func WithMaxSize(size int) Option

WithMaxSize 日志文件保存的最大 mb

func WithPath

func WithPath(path string) Option

func WithStdout

func WithStdout(stdout bool) Option

WithStdout 开启控制台输出

func WithSuffex

func WithSuffex(suffex string) Option

type Parm

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

Jump to

Keyboard shortcuts

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