Back to godoc.org

Package zap

v0.0.0-...-6667eb6
Latest Go to latest

The highest tagged major version is .

Published: Jul 29, 2020 | License: MIT | Module: github.com/Tokumicn/lego-lib

Index

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier