From 80aa6fc2a4cd5afe11931ef475cfba7ab0ef6efe Mon Sep 17 00:00:00 2001 From: Sebastien Clement Date: Wed, 29 Apr 2020 12:28:20 +0200 Subject: [PATCH] :pencil2: Add more debug logs for #8 --- .../rootfs/opt/nextcloud_backup/config/winston.js | 2 +- .../rootfs/opt/nextcloud_backup/tools/hassioApiTools.js | 6 +++++- .../rootfs/opt/nextcloud_backup/tools/webdavTools.js | 4 +--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/nextcloud_backup/rootfs/opt/nextcloud_backup/config/winston.js b/nextcloud_backup/rootfs/opt/nextcloud_backup/config/winston.js index 424907d..018c545 100644 --- a/nextcloud_backup/rootfs/opt/nextcloud_backup/config/winston.js +++ b/nextcloud_backup/rootfs/opt/nextcloud_backup/config/winston.js @@ -3,7 +3,7 @@ const winston = require('winston'); const logger = winston.createLogger({ - level: 'info', + level: 'debug', format: winston.format.combine( winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' diff --git a/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/hassioApiTools.js b/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/hassioApiTools.js index 0d6d890..461d431 100644 --- a/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/hassioApiTools.js +++ b/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/hassioApiTools.js @@ -85,6 +85,7 @@ function downloadSnapshot(id) { logger.info('Download success !') status.progress = 1; statusTools.setStatus(status); + logger.debug("Snapshot dl size : " + (fs.statSync('./temp/' + id + '.tar').size / 1024 / 1024)) resolve(); }) .pipe(stream); @@ -139,8 +140,11 @@ function checkSnap(id) { request(option, (error, response, body) => { if (error || response.statusCode != 200) reject(); - else + else{ + logger.debug("Snapshot size: " + body.data.size) resolve(); + } + }) }); diff --git a/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/webdavTools.js b/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/webdavTools.js index 72f5e79..bed581f 100644 --- a/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/webdavTools.js +++ b/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/webdavTools.js @@ -195,7 +195,7 @@ class WebdavTools { reject(status.message); } else { - logger.info("...Upload finish !"); + logger.info("...Upload finish ! (status: " + res.statusCode + ")"); status.status = "idle"; status.progress = -1; status.message = null; @@ -213,8 +213,6 @@ class WebdavTools { hassioApiTools.clean(); } resolve(); - - } }) });