Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Writer     string     `toml:"writer"`
	Level      string     `toml:"level"`
	FileConfig FileConfig `toml:"file_config"`
}

Config 日志配置项

type FileConfig

type FileConfig struct {
	Path       string `toml:"path"`
	Compress   bool   `toml:"compress"`
	MaxSize    int    `toml:"max_size"`
	MaxAge     int    `toml:"max_age"`
	MaxBackups int    `toml:"max_backups"`
}

FileConfig 日志配置项 文件类型时需要配置

type Logger

type Logger = zap.SugaredLogger

Logger 避免业务代码对zap直接依赖

func NewLogger

func NewLogger(conf Config) *Logger

NewLogger 创建zap

Source Files