X-Git-Url: http://git.osdn.net/view?p=bytom%2Fvapor.git;a=blobdiff_plain;f=cmd%2Fvapord%2Fcommands%2Finit.go;h=aa0f144cb94a97c11c478702595f6d30da4f5c87;hp=31c16a3166378208c1e7c20eacef388e24db682e;hb=3c775574439edeaa91c3b95782ebab3374a6e91f;hpb=695ef3e26fc9e184258b9b68a8249dc44b24e7e0 diff --git a/cmd/vapord/commands/init.go b/cmd/vapord/commands/init.go index 31c16a31..aa0f144c 100644 --- a/cmd/vapord/commands/init.go +++ b/cmd/vapord/commands/init.go @@ -28,7 +28,7 @@ func init() { func initFiles(cmd *cobra.Command, args []string) { configFilePath := path.Join(config.RootDir, "config.toml") if _, err := os.Stat(configFilePath); !os.IsNotExist(err) { - log.WithFields(log.Fields{"module": logModule, "config": configFilePath}).Panic("Already exists config file.") + log.WithFields(log.Fields{"module": logModule, "config": configFilePath}).Fatal("Already exists config file.") } switch config.ChainID { @@ -44,7 +44,7 @@ func initFiles(cmd *cobra.Command, args []string) { fedFilePath := config.FederationFile() if _, err := os.Stat(fedFilePath); os.IsNotExist(err) { if err := cfg.ExportFederationFile(fedFilePath, config); err != nil { - log.WithFields(log.Fields{"module": logModule, "config": fedFilePath, "error": err}).Panic("fail on export federation file") + log.WithFields(log.Fields{"module": logModule, "config": fedFilePath, "error": err}).Fatal("fail on export federation file") } } @@ -53,11 +53,11 @@ func initFiles(cmd *cobra.Command, args []string) { if _, err := os.Stat(keyFilePath); os.IsNotExist(err) { xprv, err := chainkd.NewXPrv(nil) if err != nil { - log.WithFields(log.Fields{"module": logModule, "err": err}).Panic("fail on generate private key") + log.WithFields(log.Fields{"module": logModule, "err": err}).Fatal("fail on generate private key") } if err := ioutil.WriteFile(keyFilePath, []byte(hex.EncodeToString(xprv[:])), 0600); err != nil { - log.WithFields(log.Fields{"module": logModule, "err": err}).Panic("fail on save private key") + log.WithFields(log.Fields{"module": logModule, "err": err}).Fatal("fail on save private key") } log.WithFields(log.Fields{"pubkey": xprv.XPub()}).Info("success generate private")