diff options
author | n-peugnet <n.peugnet@free.fr> | 2021-09-23 12:03:50 +0200 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2021-09-23 12:03:50 +0200 |
commit | c47d2184b2e6a1e7dbd139ca47bb3aebcfeb754f (patch) | |
tree | 251a99c8bfbececaf797dde8629d7f43334cb210 /repo.go | |
parent | 03e3d1aa9eb6e6917d2a9e6b85f7dd6f92e20d04 (diff) | |
download | dna-backup-c47d2184b2e6a1e7dbd139ca47bb3aebcfeb754f.tar.gz dna-backup-c47d2184b2e6a1e7dbd139ca47bb3aebcfeb754f.zip |
add String to Delta struct and use it in logs
Also switch to external package for slice_test as it was already a case
of "black box testing".
Diffstat (limited to 'repo.go')
-rw-r--r-- | repo.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -345,7 +345,7 @@ func slice2fileList(s slice.Slice) (ret []File) { func (r *Repo) storeFileList(version int, list []File) { dest := filepath.Join(r.path, fmt.Sprintf(versionFmt, version), filesName) delta := slice.Diff(fileList2slice(r.files), fileList2slice(list)) - logger.Info("files delta del: ", len(delta.Del), ", ins: ", len(delta.Ins)) + logger.Infof("files delta %s", delta.String()) storeBasicStruct(dest, utils.NopWriteWrapper, delta) } @@ -713,7 +713,7 @@ func slice2recipe(s slice.Slice) (ret []Chunk) { func (r *Repo) storeRecipe(version int, recipe []Chunk) { dest := filepath.Join(r.path, fmt.Sprintf(versionFmt, version), recipeName) delta := slice.Diff(recipe2slice(r.recipe), recipe2slice(recipe)) - logger.Info("recipe delta del: ", len(delta.Del), ", ins:", len(delta.Ins)) + logger.Infof("recipe delta %s", delta.String()) storeBasicStruct(dest, utils.NopWriteWrapper, delta) } |