config重构

This commit is contained in:
linwenxiang committed 2020-12-08 20:28:26 +08:00
1 parent 0810383afc
commit 5f873914e0
14 files changed
+134 -208

No files matched your search

-14
View File
@@ -1,7 +1,5 @@
package config
import "github.com/spf13/viper"
type Logger struct {
Path string
Level string
@@ -12,16 +10,4 @@ type Logger struct {
EnabledJOB bool `default:"false"`
}
func InitLog(cfg *viper.Viper) *Logger {
return &Logger{
Path: cfg.GetString("path"),
Level: cfg.GetString("level"),
Stdout: cfg.GetBool("stdout"),
EnabledBUS: cfg.GetBool("enabledbus"),
EnabledREQ: cfg.GetBool("enabledreq"),
EnabledDB: cfg.GetBool("enableddb"),
EnabledJOB: cfg.GetBool("enabledjob"),
}
}
var LoggerConfig = new(Logger)