From 8c67226823d65c83c109b7ceb9fcb2945f13593b Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Mon, 29 Apr 2019 22:39:20 +0200 Subject: [PATCH] Log-log-log! If files are found or not we output two different logs. Also info log every time we dont find anything. --- transatlanticTorrentExpress.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/transatlanticTorrentExpress.py b/transatlanticTorrentExpress.py index 3cbdc02..ef0f9fb 100755 --- a/transatlanticTorrentExpress.py +++ b/transatlanticTorrentExpress.py @@ -93,12 +93,18 @@ def main(): delugeScript = config['DELUGE']['script'] remoteFiles = getFiles(remotePath, host, user) - logger.info('Remote files found: {}'.format(remoteFiles)) + if len(remoteFiles) > 0: + logger.info('Remote files found: {}'.format(remoteFiles)) + else: + logger.info('No remote files found') # print('Remote found: {}'.format(remoteFiles)) localFiles = getFiles(localPath) # print('Local files: {}'.format(localFiles)) - logger.info('Local files found: {}'.format(localFiles)) + if len(localFiles > 0): + logger.info('Local files found: {}'.format(localFiles)) + else: + logger.info('No local files found') newFiles = filesNotShared(localFiles, remoteFiles) if (newFiles): @@ -110,7 +116,8 @@ def main(): else: - print('No new files found') + # print('No new files found to travel on the great transatlantic express') + logger.info('No new files found to travel on the great transatlantic express') if __name__ == '__main__': main()