This commit is contained in:
crusader 2018-08-22 17:17:22 +09:00
parent cb473141c2
commit db46df2133

10
log.go
View File

@ -8,9 +8,9 @@ import (
"go.uber.org/zap"
)
var logger *zap.SugaredLogger
var logger *zap.Logger
func Logger() *zap.SugaredLogger {
func Logger() *zap.Logger {
if nil == logger {
log.Panicf("Initialize Logger first to use Logger")
}
@ -31,15 +31,15 @@ func InitializeLogger(configPath string) error {
if _logger, err = zap.NewDevelopment(); nil != err {
return err
}
logger = _logger.Sugar()
logger.Infof("Logger has been initialized as development mode")
logger = _logger
logger.Info("Logger has been initialized as development mode")
return nil
}
if _logger, err = cfg.Build(); nil != err {
return err
}
logger = _logger.Sugar()
logger = _logger
return nil
}