mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-16 22:09:57 +02:00
fix logger to display exception stack includig message not just {}
This commit is contained in:
@@ -70,7 +70,10 @@ function Log(level) {
|
|||||||
//return console.log('[' + formatTime(new Date()) + '] ' , str); //eslint-disable-line no-console
|
//return console.log('[' + formatTime(new Date()) + '] ' , str); //eslint-disable-line no-console
|
||||||
args.unshift('[' + formatTime(new Date()) + '] ');
|
args.unshift('[' + formatTime(new Date()) + '] ');
|
||||||
console.log.apply(console, args.map(function(a){
|
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;
|
return a;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user