✏️ Add more debug logs for #8

This commit is contained in:
Sebastien Clement 2020-04-29 12:28:20 +02:00
parent 77259a17e6
commit 80aa6fc2a4
3 changed files with 7 additions and 5 deletions

View File

@ -3,7 +3,7 @@ const winston = require('winston');
const logger = winston.createLogger({ const logger = winston.createLogger({
level: 'info', level: 'debug',
format: winston.format.combine( format: winston.format.combine(
winston.format.timestamp({ winston.format.timestamp({
format: 'YYYY-MM-DD HH:mm:ss' format: 'YYYY-MM-DD HH:mm:ss'

View File

@ -85,6 +85,7 @@ function downloadSnapshot(id) {
logger.info('Download success !') logger.info('Download success !')
status.progress = 1; status.progress = 1;
statusTools.setStatus(status); statusTools.setStatus(status);
logger.debug("Snapshot dl size : " + (fs.statSync('./temp/' + id + '.tar').size / 1024 / 1024))
resolve(); resolve();
}) })
.pipe(stream); .pipe(stream);
@ -139,8 +140,11 @@ function checkSnap(id) {
request(option, (error, response, body) => { request(option, (error, response, body) => {
if (error || response.statusCode != 200) if (error || response.statusCode != 200)
reject(); reject();
else else{
logger.debug("Snapshot size: " + body.data.size)
resolve(); resolve();
}
}) })
}); });

View File

@ -195,7 +195,7 @@ class WebdavTools {
reject(status.message); reject(status.message);
} }
else { else {
logger.info("...Upload finish !"); logger.info("...Upload finish ! (status: " + res.statusCode + ")");
status.status = "idle"; status.status = "idle";
status.progress = -1; status.progress = -1;
status.message = null; status.message = null;
@ -213,8 +213,6 @@ class WebdavTools {
hassioApiTools.clean(); hassioApiTools.clean();
} }
resolve(); resolve();
} }
}) })
}); });