log

package
v0.0.0-...-6c2426a Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func GetID

func GetID(id uint64) *zap.Field

func Init

func Init(config Config) error

func InitDevelop

func InitDevelop(config Config)

Types

type Config

type Config struct {
	STDOUT     bool   // stdout
	File       string // log out put file path, empty means no log file
	Level      int8   // debug -1 | info 0 (default) | warn 1 | error 2
	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