Log errors to --debug-log (#95)

This commit is contained in:
Joona Hoikkala 2019-11-16 10:45:45 +02:00 committed by GitHub
parent 7aad9c6051
commit 3ad8ce2716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@ package ffuf
import ( import (
"fmt" "fmt"
"log"
"math/rand" "math/rand"
"sync" "sync"
"time" "time"
@ -163,12 +164,14 @@ func (j *Job) runTask(input map[string][]byte, position int, retried bool) {
if err != nil { if err != nil {
j.Output.Error(fmt.Sprintf("Encountered an error while preparing request: %s\n", err)) j.Output.Error(fmt.Sprintf("Encountered an error while preparing request: %s\n", err))
j.incError() j.incError()
log.Printf("%s", err)
return return
} }
resp, err := j.Runner.Execute(&req) resp, err := j.Runner.Execute(&req)
if err != nil { if err != nil {
if retried { if retried {
j.incError() j.incError()
log.Printf("%s", err)
} else { } else {
j.runTask(input, position, true) j.runTask(input, position, true)
} }
@ -214,6 +217,7 @@ func (j *Job) CalibrateResponses() ([]Response, error) {
if err != nil { if err != nil {
j.Output.Error(fmt.Sprintf("Encountered an error while preparing request: %s\n", err)) j.Output.Error(fmt.Sprintf("Encountered an error while preparing request: %s\n", err))
j.incError() j.incError()
log.Printf("%s", err)
return results, err return results, err
} }
resp, err := j.Runner.Execute(&req) resp, err := j.Runner.Execute(&req)