Skip to content

Commit

Permalink
修改配置文件名称。
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronwong1989 committed Jul 21, 2022
1 parent e5ac8b4 commit b6de48a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion cmd/ismg/cmpp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ var log = logging.GetDefaultLogger()

func main() {
rand.Seed(time.Now().Unix()) // 随机种子

cmpp.Conf = yaml_config.CreateYamlFactory("config", "cmpp", "gosms")
cmpp.Conf.ConfigFileChangeListen()

Expand Down
3 changes: 3 additions & 0 deletions comm/logging/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"
"strconv"

"github.com/aaronwong1989/yaml_config"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"gopkg.in/natefinch/lumberjack.v2"
Expand Down Expand Up @@ -64,6 +65,7 @@ func init() {
cfg.EncoderConfig.EncodeTime = zapcore.TimeEncoderOfLayout("2006-01-02T15:04:05.000")
zapLogger, _ := cfg.Build()
defaultLogger = zapLogger.Sugar()
yaml_config.SetLogger(zapLogger)
}
}

Expand Down Expand Up @@ -109,6 +111,7 @@ func CreateLoggerAsLocalFile(localFilePath string, logLevel Level) (logger Logge
zapLogger := zap.New(core, zap.AddCaller())
logger = zapLogger.Sugar()
flush = zapLogger.Sync
yaml_config.SetLogger(zapLogger)
return
}

Expand Down

0 comments on commit b6de48a

Please sign in to comment.