pkg

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(url string, path string) (err error)

func Env

func Env(key, def string) string

func LevelToZapLevel

func LevelToZapLevel(level string) zapcore.Level

func NewLogger

func NewLogger(logLevel, logFile, logtype string, logColor bool) *zap.Logger

NewLogger 自定日志配置可以参考此方法

func NewSugarLogger

func NewSugarLogger(logLevel, logFile, logType string, logColor bool) *zap.SugaredLogger

NewSugarLogger 创建一个sugar

Types

type Logger

type Logger struct {
	LogLevel      string // 日志级别
	LogFile       string // 日志文件存放路径,如果为空,则输出到控制台
	LogType       string // 日志类型,支持 txt 和 json ,默认txt
	LogMaxSize    int    //单位M
	LogMaxBackups int    // 日志文件保留个数
	LogMaxAge     int    // 单位天
	LogCompress   bool   // 压缩轮转的日志
	LogColor      bool   // 日志级别分颜色
}

func (*Logger) NewMyLogger

func (lg *Logger) NewMyLogger() *zap.Logger

Jump to

Keyboard shortcuts

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