From db62447c98fd51ba48a10bf00c074a457bb67a08 Mon Sep 17 00:00:00 2001 From: whyzdev Date: Wed, 7 Dec 2016 20:24:30 -0500 Subject: [PATCH] fix logger to display exception stack includig message not just {} --- src/logger.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/logger.js b/src/logger.js index 0173d8cac..040950adb 100644 --- a/src/logger.js +++ b/src/logger.js @@ -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; })); }