From 46484022b08f8756050aa45505ea0db23e62df8b Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 16 Mar 2023 11:56:41 +0000 Subject: [PATCH] fs: add size to JSON logs when moving or copying an object #6849 --- fs/operations/operations.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 }