From 33967236e18c33d0d83b34b76f8238c3d588b21d Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Tue, 14 Sep 2021 15:37:50 +0200 Subject: logger add panic + colors & remove ln variants & use it --- sketch/sketch.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sketch') diff --git a/sketch/sketch.go b/sketch/sketch.go index 12e62fa..ca8c238 100644 --- a/sketch/sketch.go +++ b/sketch/sketch.go @@ -4,10 +4,10 @@ import ( "bytes" "encoding/binary" "io" - "log" "sync" "github.com/chmduquesne/rollinghash/rabinkarp64" + "github.com/n-peugnet/dna-backup/logger" ) type Sketch []uint64 @@ -31,13 +31,13 @@ func SketchChunk(r io.Reader, pol rabinkarp64.Pol, chunkSize int, wSize int, sfC sfBuff := make([]byte, fBytes*fCount) chunkLen, err := chunk.ReadFrom(r) if err != nil { - log.Panicln(chunkLen, err) + logger.Panic(chunkLen, err) } for f := 0; f < int(chunkLen)/fSize; f++ { var fBuff bytes.Buffer n, err := io.CopyN(&fBuff, &chunk, int64(fSize)) if err != nil { - log.Println(n, err) + logger.Error(n, err) continue } features = append(features, 0) @@ -62,7 +62,7 @@ func calcFeature(wg *sync.WaitGroup, p rabinkarp64.Pol, r ReadByteReader, wSize hasher := rabinkarp64.NewFromPol(p) n, err := io.CopyN(hasher, r, int64(wSize)) if err != nil { - log.Println(n, err) + logger.Error(n, err) } max := hasher.Sum64() for w := 0; w < fSize-wSize; w++ { -- cgit v1.2.3