Skip to content

hellowords/zlogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zlogger

使用 github.com/uber-go/zap日志库封装

特性

支持多通道日志配置

安装

go get -u github.com/hellowords/zlogger

使用

logger := NewLogger(Options{
	Mode:       "dev" //只有在Mode为dev的时候会将日志同时输出到文件和控制台中
	LogPath:    "log/your/save/path",
	FileName:   "app",
	MaxSize:    10,
	MaxAge:     10,
	MaxBackups: 10,
})

defer logger.Sync()

logger.Default().Info("Hello Drinke9!")
logger.Default().Debug("this is debug", zap.Time("loadTime", time.Now()))
logger.Store("storeTest").Debug("store test")

About

logger by zap

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages