mirror of
https://github.com/restic/restic.git
synced 2025-12-09 04:32:44 +00:00
Merge pull request #1582 from restic/optimize-debug-log
Optimize debug logs
This commit is contained in:
@@ -182,11 +182,11 @@ type Finder struct {
|
||||
|
||||
func (f *Finder) findInTree(ctx context.Context, treeID restic.ID, prefix string) error {
|
||||
if f.notfound.Has(treeID) {
|
||||
debug.Log("%v skipping tree %v, has already been checked", prefix, treeID.Str())
|
||||
debug.Log("%v skipping tree %v, has already been checked", prefix, treeID)
|
||||
return nil
|
||||
}
|
||||
|
||||
debug.Log("%v checking tree %v\n", prefix, treeID.Str())
|
||||
debug.Log("%v checking tree %v\n", prefix, treeID)
|
||||
|
||||
tree, err := f.repo.LoadTree(ctx, treeID)
|
||||
if err != nil {
|
||||
|
||||
@@ -186,7 +186,7 @@ func pruneRepository(gopts GlobalOptions, repo restic.Repository) error {
|
||||
bar = newProgressMax(!gopts.Quiet, uint64(len(snapshots)), "snapshots")
|
||||
bar.Start()
|
||||
for _, sn := range snapshots {
|
||||
debug.Log("process snapshot %v", sn.ID().Str())
|
||||
debug.Log("process snapshot %v", sn.ID())
|
||||
|
||||
err = restic.FindUsedBlobs(ctx, repo, *sn.Tree, usedBlobs, seenBlobs)
|
||||
if err != nil {
|
||||
@@ -197,7 +197,7 @@ func pruneRepository(gopts GlobalOptions, repo restic.Repository) error {
|
||||
return err
|
||||
}
|
||||
|
||||
debug.Log("processed snapshot %v", sn.ID().Str())
|
||||
debug.Log("processed snapshot %v", sn.ID())
|
||||
bar.Report(restic.Stat{Blobs: 1})
|
||||
}
|
||||
bar.Done()
|
||||
|
||||
@@ -82,7 +82,7 @@ func changeTags(ctx context.Context, repo *repository.Repository, sn *restic.Sna
|
||||
return false, err
|
||||
}
|
||||
|
||||
debug.Log("new snapshot saved as %v", id.Str())
|
||||
debug.Log("new snapshot saved as %v", id)
|
||||
|
||||
if err = repo.Flush(ctx); err != nil {
|
||||
return false, err
|
||||
|
||||
Reference in New Issue
Block a user