完成日志输出到文件、终端多处的处理
This commit is contained in:
@@ -6,7 +6,7 @@ package cmd
|
||||
import (
|
||||
"game-driver/config"
|
||||
"game-driver/internal"
|
||||
"game-driver/pkg/logger"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -56,11 +56,11 @@ func initConfig() {
|
||||
|
||||
// If a config file is found, read it in.
|
||||
if err := viper.ReadInConfig(); err == nil {
|
||||
logger.Infof("Using config file: %s", viper.ConfigFileUsed())
|
||||
log.Printf("Using config file: %s", viper.ConfigFileUsed())
|
||||
}
|
||||
|
||||
err := viper.Unmarshal(&config.C)
|
||||
if err != nil {
|
||||
logger.Panicln("unmarshal config failed: ", err)
|
||||
log.Panicln("unmarshal config failed: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user