1 Star 0 Fork 0

ww156 / notify

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
log.go 483 Bytes
一键复制 编辑 原始数据 按行查看 历史
ww156 提交于 2021-12-17 10:41 . first commit
/*
# @Author ww
# @Time 2019/10/28 10:01
# @File log.go
*/
package log
import (
"encoding/json"
"go.uber.org/zap"
)
var (
Logger *zap.Logger
)
func init() {
rawJSON := []byte(`{
"level": "debug",
"encoding": "json",
"outputPaths": ["stdout", "/tmp/logs"],
"errorOutputPaths": ["stderr"],
}`)
var cfg zap.Config
if err := json.Unmarshal(rawJSON, &cfg); err != nil {
panic(err)
}
logger, err := cfg.Build()
if err != nil {
panic(err)
}
Logger = logger
}
1
https://gitee.com/childewang/notify.git
git@gitee.com:childewang/notify.git
childewang
notify
notify
34056af3f771

搜索帮助