zap

package
v0.0.0-...-c20c62a Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Logger *zap.Logger
	Sugar  *zap.SugaredLogger
)

Functions

func Init

func Init(config Config)

Types

type Config

type Config struct {
	LogFile    string // 日志文件路径, 不传则不写文件
	LogLevel   string // debug | info | warn | error
	MaxAge     int    // 保存的天数, 默认不删除
	MaxSize    int    // 单个文件大小 MB
	MaxBackups int    // 最多保留的备份数
	Compress   bool   // 是否压缩
	JsonFormat bool   // 是否用 json 格式
}

Jump to

Keyboard shortcuts

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