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 --- repo_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'repo_test.go') diff --git a/repo_test.go b/repo_test.go index 8748d88..b16ddc6 100644 --- a/repo_test.go +++ b/repo_test.go @@ -5,12 +5,12 @@ import ( "fmt" "io" "io/ioutil" - "log" "os" "path/filepath" "reflect" "testing" + "github.com/n-peugnet/dna-backup/logger" "github.com/n-peugnet/dna-backup/utils" ) @@ -71,7 +71,7 @@ func (r *Repo) chunkStream(stream io.Reader, chunks chan<- []byte) { prev += read } if err != nil && err != io.EOF { - log.Println(err) + logger.Error(err) } if prev == r.chunkSize { chunks <- buff @@ -89,7 +89,7 @@ func storeChunks(dest string, chunks <-chan []byte) { path := filepath.Join(dest, fmt.Sprintf(chunkIdFmt, i)) err := os.WriteFile(path, c, 0664) if err != nil { - log.Println(err) + logger.Error(err) } i++ } @@ -240,7 +240,7 @@ func TestBsdiff(t *testing.T) { newChunks := extractDeltaChunks(recipe) assertLen(t, 2, newChunks, "New delta chunks:") for _, c := range newChunks { - log.Println("Patch size:", len(c.Patch)) + logger.Info("Patch size:", len(c.Patch)) if len(c.Patch) >= repo.chunkSize/10 { t.Errorf("Bsdiff of chunk is too large: %d", len(c.Patch)) } -- cgit v1.2.3