Merge pull request #1582 from restic/optimize-debug-log

Optimize debug logs
This commit is contained in:
Alexander Neumann
2018-01-26 21:57:18 +01:00
18 changed files with 93 additions and 82 deletions

View File

@@ -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 {

View File

@@ -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()

View File

@@ -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