From 48dafda06c37ffc480df1c185db6e411884b8d5c Mon Sep 17 00:00:00 2001 From: Abhinav Date: Sat, 15 Oct 2022 14:54:03 +0530 Subject: [PATCH] improve logging --- src/services/watchFolder/watchFolderService.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/services/watchFolder/watchFolderService.ts b/src/services/watchFolder/watchFolderService.ts index 815aef62c..f59219c13 100644 --- a/src/services/watchFolder/watchFolderService.ts +++ b/src/services/watchFolder/watchFolderService.ts @@ -245,6 +245,9 @@ class watchFolderService { } const event = this.clubSameCollectionEvents(); + addLogLine( + `running event type:${event.type} collectionName:${event.collectionName} folderPath:${event.folderPath} , fileCount:${event.files?.length} pathsCount: ${event.paths?.length}` + ); const mappings = this.getWatchMappings(); const mapping = mappings.find( (mapping) => mapping.folderPath === event.folderPath @@ -252,6 +255,9 @@ class watchFolderService { if (!mapping) { throw Error('no Mapping found for event'); } + addLogLine( + `mapping for event rootFolder: ${mapping.rootFolderName} folderPath: ${mapping.folderPath} uploadStrategy: ${mapping.uploadStrategy} syncedFilesCount: ${mapping.syncedFiles.length} ignoredFilesCount ${mapping.ignoredFiles.length}` + ); if (event.type === 'upload') { event.files = getValidFilesToUpload(event.files, mapping); if (event.files.length === 0) { @@ -260,9 +266,6 @@ class watchFolderService { } this.currentEvent = event; this.currentlySyncedMapping = mapping; - addLogLine( - `running event type:${event.type} collectionName:${event.collectionName} folderPath:${event.folderPath} , fileCount:${event.files?.length} pathsCount: ${event.paths?.length}` - ); if (event.type === 'upload') { this.processUploadEvent();