From 51615bff0b505756ce1b73eecac43150070fd3cf Mon Sep 17 00:00:00 2001 From: abraunegg Date: Fri, 15 Feb 2019 07:03:15 +1100 Subject: [PATCH] Rework PR #373 to reduce needless logging in monitor mode (#376) * Rework PR #373 to reduce needless logging in monitor mode --- src/main.d | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main.d b/src/main.d index e58afda5..0b724cf1 100644 --- a/src/main.d +++ b/src/main.d @@ -480,7 +480,7 @@ int main(string[] args) } // Perform the sync - performSync(sync, singleDirectory, downloadOnly, localFirst, uploadOnly); + performSync(sync, singleDirectory, downloadOnly, localFirst, uploadOnly, monitor); } } @@ -549,7 +549,7 @@ int main(string[] args) return EXIT_FAILURE; } try { - performSync(sync, singleDirectory, downloadOnly, localFirst, uploadOnly); + performSync(sync, singleDirectory, downloadOnly, localFirst, uploadOnly, monitor); if (!downloadOnly) { // discard all events that may have been generated by the sync m.update(false); @@ -597,7 +597,7 @@ bool initSyncEngine(SyncEngine sync) } // try to synchronize the folder three times -void performSync(SyncEngine sync, string singleDirectory, bool downloadOnly, bool localFirst, bool uploadOnly) +void performSync(SyncEngine sync, string singleDirectory, bool downloadOnly, bool localFirst, bool uploadOnly, bool monitor) { int count; string remotePath = "/"; @@ -617,18 +617,18 @@ void performSync(SyncEngine sync, string singleDirectory, bool downloadOnly, boo log.vlog("Syncing changes from this selected path: ", singleDirectory); if (uploadOnly){ // Upload Only of selected single directory - log.log("Syncing changes from selected local path only - NOT syncing data changes from OneDrive ..."); + if (!monitor) log.log("Syncing changes from selected local path only - NOT syncing data changes from OneDrive ..."); sync.scanForDifferences(localPath); } else { // No upload only if (localFirst) { // Local First - log.log("Syncing changes from selected local path first before downloading changes from OneDrive ..."); + if (!monitor) log.log("Syncing changes from selected local path first before downloading changes from OneDrive ..."); sync.scanForDifferences(localPath); sync.applyDifferencesSingleDirectory(remotePath); } else { // OneDrive First - log.log("Syncing changes from selected OneDrive path ..."); + if (!monitor) log.log("Syncing changes from selected OneDrive path ..."); sync.applyDifferencesSingleDirectory(remotePath); // is this a download only request? if (!downloadOnly) { @@ -643,13 +643,13 @@ void performSync(SyncEngine sync, string singleDirectory, bool downloadOnly, boo // no single directory sync if (uploadOnly){ // Upload Only of entire sync_dir - log.log("Syncing changes from local path only - NOT syncing data changes from OneDrive ..."); + if (!monitor) log.log("Syncing changes from local path only - NOT syncing data changes from OneDrive ..."); sync.scanForDifferences(localPath); } else { // No upload only if (localFirst) { // sync local files first before downloading from OneDrive - log.log("Syncing changes from local path first before downloading changes from OneDrive ..."); + if (!monitor) log.log("Syncing changes from local path first before downloading changes from OneDrive ..."); sync.scanForDifferences(localPath); sync.applyDifferences(); } else {