mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-11-22 17:22:58 +01:00
✏️ Add more debug logs for #8
This commit is contained in:
parent
77259a17e6
commit
80aa6fc2a4
@ -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'
|
||||||
|
@ -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();
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -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();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user