Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

fs: add size to JSON logs when moving or copying an object #6849

Nick Craig-Wood46484022b08f
diff --git a/fs/operations/operations.go b/fs/operations/operations.go
index 0740a198d..75f97a17f 100644
--- a/fs/operations/operations.go
+++ b/fs/operations/operations.go
@@ -500,10 +500,9 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj
}
}
if newDst != nil && src.String() != newDst.String() {
- fs.Infof(src, "%s to: %s", actionTaken, newDst.String())
- } else {
- fs.Infof(src, actionTaken)
+ actionTaken = fmt.Sprintf("%s to: %s", actionTaken, newDst.String())
}
+ fs.Infof(src, "%s%s", actionTaken, fs.LogValueHide("size", fs.SizeSuffix(src.Size())))
return newDst, err
}