Skip to content

Commit 35cf49b

Browse files
committed
improved some debug logging
1 parent 49c4f7d commit 35cf49b

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

check/checkrr.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ import (
44
"context"
55
"encoding/hex"
66
"encoding/json"
7-
"github.com/aetaric/checkrr/logging"
8-
"github.com/knadh/koanf/v2"
9-
"github.com/nicksnyder/go-i18n/v2/i18n"
107
"net/http"
118
"os"
129
"path/filepath"
1310
"strings"
1411
"time"
1512

13+
"github.com/aetaric/checkrr/logging"
14+
"github.com/knadh/koanf/v2"
15+
"github.com/nicksnyder/go-i18n/v2/i18n"
16+
1617
"github.com/aetaric/checkrr/connections"
1718
"github.com/aetaric/checkrr/features"
1819
"github.com/aetaric/checkrr/hidden"
@@ -225,6 +226,7 @@ func (c *Checkrr) Run() {
225226
c.notifications.Notify(title, desc, "endrun", "")
226227
c.Stats.Stop()
227228
c.Stats.Render()
229+
c.csv.Close()
228230
c.Running = false
229231
ch := *c.Chan
230232
ch <- []string{"time"}
@@ -642,8 +644,8 @@ func (c *Checkrr) recordBadFile(path string, fileType string, reason string) {
642644
})
643645
c.Logger.WithFields(log.Fields{"DB Update": "Failure"}).Warn(message)
644646
}
645-
646-
if c.config.String("csvfile") != "" {
647+
if len(c.config.String("csvfile")) > 0 {
648+
log.Debug("writting bad file to csv")
647649
c.csv.Write(path, fileType)
648650
}
649651
}

0 commit comments

Comments
 (0)