diff --git a/common/flag.go b/common/flag.go index 9f41011..4ba219b 100644 --- a/common/flag.go +++ b/common/flag.go @@ -38,7 +38,7 @@ func Flag(Info *HostInfo) { flag.BoolVar(&Ping, "ping", false, "using ping replace icmp") flag.StringVar(&TmpOutputfile, "o", "result.txt", "Outputfile") flag.BoolVar(&TmpSave, "no", false, "not to save output log") - flag.Int64Var(&LogErrTime, "debug", 120, "every time to LogErr") + flag.Int64Var(&WaitTime, "debug", 120, "every time to LogErr") flag.StringVar(&URL, "u", "", "url") flag.StringVar(&UrlFile, "uf", "", "urlfile") flag.StringVar(&Pocinfo.PocName, "pocname", "", "use the pocs these contain pocname, -pocname weblogic") diff --git a/common/log.go b/common/log.go index b7b6514..9d784ea 100644 --- a/common/log.go +++ b/common/log.go @@ -48,7 +48,9 @@ func WriteFile(result string, filename string) { } func LogError(errinfo interface{}) { - if (time.Now().Unix()-LogSucTime) > WaitTime && (time.Now().Unix()-LogErrTime) > WaitTime { + if WaitTime == 0 { + fmt.Println(fmt.Sprintf("已完成 %v/%v %v", End, Num, errinfo)) + } else if (time.Now().Unix()-LogSucTime) > WaitTime && (time.Now().Unix()-LogErrTime) > WaitTime { fmt.Println(fmt.Sprintf("已完成 %v/%v %v", End, Num, errinfo)) LogErrTime = time.Now().Unix() }