From 5e0e7633172de2b271966acdea92811963a9ab6a Mon Sep 17 00:00:00 2001 From: abraunegg Date: Tue, 10 Apr 2018 20:03:28 +1000 Subject: [PATCH] Change logging of upload, download and deletion activities Prior to this change logging of upload, download and deletion activities were only written to the log file when using the --verbose flag, however they would be written to console / syslog. This corrects that behaviour. --- src/sync.d | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sync.d b/src/sync.d index b258ff27..7b9d5269 100644 --- a/src/sync.d +++ b/src/sync.d @@ -488,6 +488,7 @@ final class SyncEngine onedrive.downloadById(item.driveId, item.id, path); setTimes(path, item.mtime, item.mtime); writeln(" done."); + log.log("Downloading ", path, "... done."); } // returns true if the given item corresponds to the local one @@ -533,7 +534,7 @@ final class SyncEngine Item item; if (!itemdb.selectById(i[0], i[1], item)) continue; // check if the item is in the db string path = itemdb.computePath(i[0], i[1]); - log.log("Deleting ", path); + log.log("Deleting item ", path); itemdb.deleteById(item.driveId, item.id); if (item.remoteDriveId != null) { // delete the linked remote folder @@ -679,7 +680,7 @@ final class SyncEngine writeln(""); response = session.upload(path, item.driveId, item.parentId, baseName(path), eTag); } - log.vlog("Uploading file ", path, "... done."); + log.log("Uploading file ", path, "... done."); // saveItem(response); redundant // use the cTag instead of the eTag because Onedrive may update the metadata of files AFTER they have been uploaded eTag = response["cTag"].str; @@ -869,7 +870,7 @@ final class SyncEngine writeln(""); response = session.upload(path, parent.driveId, parent.id, baseName(path)); } - log.vlog("Uploading file ", path, "... done."); + log.log("Uploading file ", path, "... done."); string id = response["id"].str; string cTag = response["cTag"].str; SysTime mtime = timeLastModified(path).toUTC(); @@ -898,7 +899,7 @@ final class SyncEngine writeln(""); response = session.upload(path, parent.driveId, parent.id, baseName(path)); } - log.vlog("Uploading file ", path, "... done."); + log.log("Uploading file ", path, "... done."); string id = response["id"].str; string cTag = response["cTag"].str; SysTime mtime = timeLastModified(path).toUTC(); @@ -913,7 +914,7 @@ final class SyncEngine private void uploadDeleteItem(Item item, string path) { - log.log("Deleting directory from OneDrive: ", path); + log.log("Deleting item from OneDrive: ", path); if ((item.driveId == "") && (item.id == "") && (item.eTag == "")){ // These are empty ... we cannot delete if this is empty ....