This commit is contained in:
wangchuxiao
2023-03-10 20:02:07 +08:00
parent bebe89162f
commit c624880863
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -20,8 +20,12 @@ func NewRootCmd() (rootCmd *RootCmd) {
Short: "Start the server",
Long: `Start the server`,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
err := rootCmd.getConfFromCmdAndInit(cmd)
if err != nil {
return err
}
log.InitFromConfig("newlog")
return rootCmd.getConfFromCmdAndInit(cmd)
return nil
},
}
rootCmd.Command = c