1 Star 0 Fork 0

ww156 / notify

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
log.go 483 Bytes
Copy Edit Raw Blame History
ww156 authored 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
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/childewang/notify.git
git@gitee.com:childewang/notify.git
childewang
notify
notify
34056af3f771

Search

344bd9b3 5694891 D2dac590 5694891