reword and fix error logging

This commit is contained in:
Dustin Decker 2022-06-13 16:14:22 -07:00
parent e123e9f177
commit 2178f1f42e
3 changed files with 5 additions and 4 deletions

View file

@ -7,7 +7,7 @@ COPY . .
RUN CGO_ENABLED=0 go build -a -o trufflehog main.go
FROM alpine:3.15
RUN apk add --no-cache git
RUN apk add --no-cache git; mkdir /tmp
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /build/trufflehog /usr/bin/trufflehog
ENTRYPOINT ["/usr/bin/trufflehog"]

View file

@ -2,6 +2,7 @@ FROM alpine:3.15
RUN apk add --no-cache git
WORKDIR /usr/bin/
RUN mkdir /tmp
COPY trufflehog .
ENTRYPOINT ["/usr/bin/trufflehog"]

View file

@ -248,9 +248,9 @@ func (s *Source) pageChunker(ctx context.Context, client *s3.S3, chunksChan chan
errorCount.Store(prefix, nErr)
//too many consective errors on this page
if nErr.(int) > 3 {
s.log.Warnf("Too many consecutive errors. Blacklisting %s", prefix)
s.log.Warnf("Too many consecutive errors. Excluding %s", prefix)
}
log.Debugf("Error Counts: %s:%s", prefix, nErr)
log.Debugf("Error Counts: %s:%d", prefix, nErr)
return
}
body, err := ioutil.ReadAll(res.Body)
@ -269,7 +269,7 @@ func (s *Source) pageChunker(ctx context.Context, client *s3.S3, chunksChan chan
errorCount.Store(prefix, nErr)
if nErr.(int) > 3 {
s.log.Warnf("Too many consecutive errors. Blacklisting %s", prefix)
s.log.Warnf("Too many consecutive errors. Excluding %s", prefix)
}
return
}