37 Star 411 Fork 76

GVPrancher/rancher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
logwriter.go 449 Bytes
一键复制 编辑 原始数据 按行查看 历史
Aiwantaozi 提交于 2018-09-13 16:49 . enhance audit log
package audit
import (
lumberjack "gopkg.in/natefinch/lumberjack.v2"
)
type LogWriter struct {
Level int
Output *lumberjack.Logger
}
func NewLogWriter(path string, level, maxAge, maxBackup, maxSize int) *LogWriter {
if path == "" || level == levelNull {
return nil
}
return &LogWriter{
Level: level,
Output: &lumberjack.Logger{
Filename: path,
MaxAge: maxAge,
MaxBackups: maxBackup,
MaxSize: maxSize,
},
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/rancher/rancher.git
git@gitee.com:rancher/rancher.git
rancher
rancher
rancher
v2.2.4-rc22

搜索帮助

0d507c66 1850385 C8b1a773 1850385