logging/logging.go
crusader e489d57791 ing
2017-09-19 15:00:20 +09:00

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)
}
}