change: PersistentPreRun log setting

This commit is contained in:
debugtalk
2021-10-18 10:13:27 +08:00
parent a270af016c
commit cc16ad51d6
5 changed files with 7 additions and 17 deletions
+6
View File
@@ -18,6 +18,12 @@ var RootCmd = &cobra.Command{
License: Apache-2.0
Github: https://github.com/httprunner/hrp
Copyright 2021 debugtalk`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if !logJSON {
hrp.SetLogPretty()
}
hrp.SetLogLevel(logLevel)
},
Version: hrp.VERSION,
}