全面替换log为zap
This commit is contained in:
@@ -4,10 +4,9 @@ Copyright © 2024 慕枫Go <mapleafgo@163.com>
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"game-driver/config"
|
||||
"game-driver/internal"
|
||||
"log"
|
||||
"game-driver/pkg/logger"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -57,11 +56,11 @@ func initConfig() {
|
||||
|
||||
// If a config file is found, read it in.
|
||||
if err := viper.ReadInConfig(); err == nil {
|
||||
fmt.Fprintln(os.Stderr, "Using config file:", viper.ConfigFileUsed())
|
||||
logger.Infof("Using config file: %s", viper.ConfigFileUsed())
|
||||
}
|
||||
|
||||
err := viper.Unmarshal(&config.C)
|
||||
if err != nil {
|
||||
log.Panicln("unmarshal config failed: ", err)
|
||||
logger.Panicln("unmarshal config failed: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user