logs

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(options ...zap.Option) *zap.Logger

func MyTimeEncoder

func MyTimeEncoder(t time.Time, e zapcore.PrimitiveArrayEncoder)

MyTimeEncoder 自定义时间格式化

func New

func New(cfg *Config) *zap.Logger

Types

type Config added in v0.2.2

type Config struct {
	// Filename 日志名称
	Filename string
	// Level 日志级别
	Level zapcore.Level
	// MaxSize 当前文件多大时轮替;默认:100MB
	MaxSize int
	// MaxAge 轮替的旧文件最大保留时长;默认:不限
	MaxAge int
	// MaxBackups 轮替的旧文件最大保留数量;默认:不限
	MaxBackups int
	// Compress 轮替的旧文件是否压缩;默认:不压缩
	Compress bool
	// Stderr 是否输出到控制台
	Stderr bool
	// Options Zap日志选项
	Options []zap.Option
}

Config 日志初始化配置

Jump to

Keyboard shortcuts

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