diff --git a/storage/cmd/root.go b/storage/cmd/root.go index e011f95..b4c00f4 100644 --- a/storage/cmd/root.go +++ b/storage/cmd/root.go @@ -3,14 +3,16 @@ package cmd import ( "fmt" - "gitee.com/timedb/wheatCache/storage/server/single" "log" "net" "os" "os/signal" "syscall" + "gitee.com/timedb/wheatCache/storage/server/single" + _ "gitee.com/timedb/wheatCache/conf" + "gitee.com/timedb/wheatCache/pkg/logx" "gitee.com/timedb/wheatCache/pkg/proto" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -25,7 +27,6 @@ var rootCmd = &cobra.Command{ Long: `start storage server`, Run: func(cmd *cobra.Command, args []string) { storageServer := single.NewServer() - // 先写死, 等配置文件 conf := viper.GetStringMap("storage") host := conf["host"].(string) port := conf["port"].(int) @@ -37,7 +38,7 @@ var rootCmd = &cobra.Command{ listen, err := net.ListenTCP("tcp", tcpAddr) if err != nil { - log.Panicln(err) + logx.Panicln(err) } s := grpc.NewServer() proto.RegisterCommServerServer(s, storageServer)