refactor: logger

This commit is contained in:
debugtalk
2021-12-22 19:36:53 +08:00
parent 8ef4ad4282
commit 920e0a9431
15 changed files with 48 additions and 62 deletions
+6 -1
View File
@@ -15,12 +15,17 @@ var runCmd = &cobra.Command{
$ hrp run demo.yaml # run specified yaml testcase file
$ hrp run examples/ # run testcases in specified folder`,
Args: cobra.MinimumNArgs(1),
PreRun: func(cmd *cobra.Command, args []string) {
setLogLevel(logLevel)
},
RunE: func(cmd *cobra.Command, args []string) error {
var paths []hrp.ITestCase
for _, arg := range args {
paths = append(paths, &hrp.TestCasePath{Path: arg})
}
runner := hrp.NewRunner(nil).SetDebug(!silentFlag).SetFailfast(!continueOnFailure)
runner := hrp.NewRunner(nil).
SetDebug(!silentFlag).
SetFailfast(!continueOnFailure)
if proxyUrl != "" {
runner.SetProxyUrl(proxyUrl)
}