From 7f2f7df67e0408a55c943ac0a48b4ba080010aa6 Mon Sep 17 00:00:00 2001 From: shadow1ng Date: Wed, 31 Mar 2021 17:58:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9-debug=E5=8F=82=E6=95=B0,?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=89=93=E5=8D=B0=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=97=B6=E9=97=B4,=E9=BB=98=E8=AE=A4100?= =?UTF-8?q?=E7=A7=92=E6=B2=A1=E8=BF=9B=E5=88=B6=E5=B0=B1=E4=BC=9A=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E3=80=82-debug=200=E6=97=B6,=E6=9C=89err=E6=97=B6?= =?UTF-8?q?=E5=B0=B1=E4=BC=9A=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/flag.go | 2 +- common/log.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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() }