logger

package
v0.0.0-...-f79bcc6 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZapDrive    = "zap"
	ZapStdDrive = "zapStd"
)

Variables

This section is empty.

Functions

func New

func New(cfg *Config) (*zap.SugaredLogger, error)

func NewZapLogger

func NewZapLogger(cfg *Config) (*zap.SugaredLogger, error)

func NewZapSTDLogger

func NewZapSTDLogger(cfg *Config) (*zap.SugaredLogger, error)

Types

type Config

type Config struct {
	Drive       string        `yaml:"drive"`       // 驱动
	Path        string        `yaml:"path"`        // 路径
	File        string        `yaml:"file"`        // 文件名
	MaxAge      time.Duration `yaml:"maxAge"`      // 最大保存时间
	MaxBackups  int           `yaml:"maxBackups"`  // 最大文件个数
	MaxFileSize int           `yaml:"maxFileSize"` // 文件大小
	Level       int8          `yaml:"level"`       // 级别
	Compress    bool          `yaml:"compress"`    // 是否压缩
	LocalTime   bool          `yaml:"localTime"`   // 是否使用当地时间

}

Jump to

Keyboard shortcuts

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