fix logger to display exception stack includig message not just {}

This commit is contained in:
whyzdev 2016-12-07 20:24:30 -05:00
parent b96ae68aee
commit db62447c98
1 changed files with 4 additions and 1 deletions

View File

@ -70,7 +70,10 @@ function Log(level) {
//return console.log('[' + formatTime(new Date()) + '] ' , str); //eslint-disable-line no-console
args.unshift('[' + formatTime(new Date()) + '] ');
console.log.apply(console, args.map(function(a){
if (typeof a === "object") return JSON.stringify(a, null, 2);
if (typeof a === "object") {
if (a.stack !== undefined) { return a.stack; }
return JSON.stringify(a, null, 2);
}
return a;
}));
}