Added custom logger. Right now, not configurable.
This commit is contained in:
@ -2,7 +2,7 @@ package middleware
|
||||
|
||||
import (
|
||||
"github.com/geziyor/geziyor/client"
|
||||
"log"
|
||||
"github.com/geziyor/geziyor/internal"
|
||||
"sync"
|
||||
)
|
||||
|
||||
@ -18,7 +18,7 @@ func (a *DuplicateRequests) ProcessRequest(r *client.Request) {
|
||||
requestURL := r.Request.URL.String()
|
||||
if _, visited := a.visitedURLs.LoadOrStore(requestURL, struct{}{}); visited {
|
||||
if _, logged := a.logOnlyOnce.LoadOrStore(requestURL, struct{}{}); !logged {
|
||||
log.Printf("URL already visited %s\n", requestURL)
|
||||
internal.Logger.Printf("URL already visited %s\n", requestURL)
|
||||
}
|
||||
r.Cancel()
|
||||
}
|
||||
|
Reference in New Issue
Block a user