tweak debug logs

This commit is contained in:
Michael Eischer 2023-04-23 11:38:06 +02:00
parent 22562d2132
commit cdb0fb9c06
3 changed files with 4 additions and 3 deletions

View file

@ -105,14 +105,15 @@ func (s *TreeSaver) save(ctx context.Context, job *saveTreeJob) (*restic.Node, I
continue continue
} }
debug.Log("insert %v", fnr.node.Name)
err := builder.AddNode(fnr.node) err := builder.AddNode(fnr.node)
if err != nil && errors.Is(err, restic.ErrTreeNotOrdered) && lastNode != nil && fnr.node.Equals(*lastNode) { if err != nil && errors.Is(err, restic.ErrTreeNotOrdered) && lastNode != nil && fnr.node.Equals(*lastNode) {
debug.Log("insert %v failed: %v", fnr.node.Name, err)
// ignore error if an _identical_ node already exists, but nevertheless issue a warning // ignore error if an _identical_ node already exists, but nevertheless issue a warning
_ = s.errFn(fnr.target, err) _ = s.errFn(fnr.target, err)
err = nil err = nil
} }
if err != nil { if err != nil {
debug.Log("insert %v failed: %v", fnr.node.Name, err)
return nil, stats, err return nil, stats, err
} }
lastNode = fnr.node lastNode = fnr.node

View file

@ -41,7 +41,7 @@ func ParallelList(ctx context.Context, r Lister, t FileType, parallelism uint, f
// a worker receives an index ID from ch, loads the index, and sends it to indexCh // a worker receives an index ID from ch, loads the index, and sends it to indexCh
worker := func() error { worker := func() error {
for fi := range ch { for fi := range ch {
debug.Log("worker got file %v", fi.ID.Str()) debug.Log("worker got file %v/%v", t, fi.ID.Str())
err := fn(ctx, fi.ID, fi.Size) err := fn(ctx, fi.ID, fi.Size)
if err != nil { if err != nil {
return err return err

View file

@ -37,7 +37,7 @@ func FilterTree(ctx context.Context, repo BlobLoadSaver, nodepath string, nodeID
return restic.ID{}, err return restic.ID{}, err
} }
if nodeID != testID { if nodeID != testID {
return restic.ID{}, fmt.Errorf("cannot encode tree at %q without loosing information", nodepath) return restic.ID{}, fmt.Errorf("cannot encode tree at %q without losing information", nodepath)
} }
debug.Log("filterTree: %s, nodeId: %s\n", nodepath, nodeID.Str()) debug.Log("filterTree: %s, nodeId: %s\n", nodepath, nodeID.Str())