1
mirror of https://github.com/rclone/rclone synced 2024-10-03 09:57:50 +02:00

operations: move and copy log name of the destination object in verbose

If the object is moved or copied rclone in verbose mode prints name of the
destination object into the info log.
This commit is contained in:
Adam Plánský 2020-10-26 21:44:01 +01:00 committed by Nick Craig-Wood
parent 0cfa89f316
commit 127f0fc64c

View File

@ -501,8 +501,11 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj
return newDst, err return newDst, err
} }
} }
if src.String() != newDst.String() {
fs.Infof(src, "%s to: %s", actionTaken, newDst.String())
} else {
fs.Infof(src, actionTaken) fs.Infof(src, actionTaken)
}
return newDst, err return newDst, err
} }
@ -556,7 +559,12 @@ func Move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs.
newDst, err = doMove(ctx, src, remote) newDst, err = doMove(ctx, src, remote)
switch err { switch err {
case nil: case nil:
if src.String() != newDst.String() {
fs.Infof(src, "Moved (server-side) to: %s", newDst.String())
} else {
fs.Infof(src, "Moved (server-side)") fs.Infof(src, "Moved (server-side)")
}
return newDst, nil return newDst, nil
case fs.ErrorCantMove: case fs.ErrorCantMove:
fs.Debugf(src, "Can't move, switching to copy") fs.Debugf(src, "Can't move, switching to copy")