This commit is contained in:
wangchuxiao
2023-03-13 10:03:23 +08:00
parent a348af74fa
commit d73ab781fe
4 changed files with 26 additions and 13 deletions
+1 -6
View File
@@ -3,7 +3,6 @@ package cmd
import (
"OpenIM/pkg/common/config"
"OpenIM/pkg/common/constant"
log "OpenIM/pkg/common/logger"
"github.com/spf13/cobra"
)
@@ -20,11 +19,7 @@ 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
}
return log.InitFromConfig("newlog")
return rootCmd.getConfFromCmdAndInit(cmd)
},
}
rootCmd.Command = c