26 lines
349 B
Go
26 lines
349 B
Go
package logging
|
|
|
|
import (
|
|
"git.loafle.net/commons_go/config"
|
|
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
var Logger *zap.Logger
|
|
|
|
func init() {
|
|
var cfg zap.Config
|
|
var err error
|
|
|
|
conf := config.New()
|
|
conf.SetConfigPath("./config")
|
|
|
|
if err = conf.Load(&cfg, "logging.json"); nil != err {
|
|
panic(err)
|
|
}
|
|
|
|
if Logger, err = cfg.Build(); nil != err {
|
|
panic(err)
|
|
}
|
|
}
|