Merge pull request #252 from ruishawn/dev2

fix: 精简打印日志模块冗余代码
This commit is contained in:
影舞者 2022-12-14 09:58:09 +08:00 committed by GitHub
commit eb5558e6d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,9 +57,9 @@ func WriteFile(result string, filename string) {
func LogError(errinfo interface{}) {
if WaitTime == 0 {
fmt.Println(fmt.Sprintf("已完成 %v/%v %v", End, Num, errinfo))
fmt.Printf("已完成 %v/%v %v \n", 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))
fmt.Printf("已完成 %v/%v %v \n", End, Num, errinfo)
LogErrTime = time.Now().Unix()
}
}