operations: add size if known to skipped items and JSON log - fixes #4624
This commit is contained in:
parent
e972f2c98a
commit
dd67a3d5f5
1 changed files with 9 additions and 1 deletions
|
@ -2123,7 +2123,15 @@ func SkipDestructive(ctx context.Context, subject interface{}, action string) (s
|
|||
return false
|
||||
}
|
||||
if skip {
|
||||
fs.Logf(subject, "Skipped %s as %s is set", action, flag)
|
||||
size := int64(-1)
|
||||
if do, ok := subject.(interface{ Size() int64 }); ok {
|
||||
size = do.Size()
|
||||
}
|
||||
if size >= 0 {
|
||||
fs.Logf(subject, "Skipped %s as %s is set (size %v)", fs.LogValue("skipped", action), flag, fs.LogValue("size", fs.SizeSuffix(size)))
|
||||
} else {
|
||||
fs.Logf(subject, "Skipped %s as %s is set", fs.LogValue("skipped", action), flag)
|
||||
}
|
||||
}
|
||||
return skip
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue