fix(logger): improve logging and make sure no data is lost

This commit is contained in:
Matteo Pagliazzi
2020-03-24 20:29:31 +01:00
parent 3458d89c1d
commit 2cd0ed5973
5 changed files with 130 additions and 46 deletions

View File

@@ -71,9 +71,9 @@ function sendNotification (user, details = {}) {
.then(response => {
response.failed.forEach(failure => {
if (failure.error) {
logger.error('APN error', failure.error);
logger.error(new Error('APN error'), { failure });
} else {
logger.error('APN transmissionError', failure.status, notification, failure.device);
logger.error(new Error('APN transmissionError'), { failure, notification });
}
});
})