feat:update log

This commit is contained in:
wenjianzhang committed 2020-07-24 18:10:25 +08:00
1 parent 0768efbcb3
commit f3adadd6ef
20 files changed
+194 -146

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
package config
import "github.com/spf13/viper"
type Logger struct {
Path string
Level string
Stdout bool
Enabled bool
}
func InitLog(cfg *viper.Viper) *Logger {
return &Logger{
Path: cfg.GetString("path"),
Level: cfg.GetString("level"),
Enabled: cfg.GetBool("enabled"),
Stdout: cfg.GetBool("stdout"),
}
}
var LoggerConfig = new(Logger)