X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/baae83e34afb199c43dea6c37ad607987fb93ebb..9abc2f052e1503f396f118e9508b14cb8b276e39:/src/fnpjs/logging/handlers.js?ds=sidebyside diff --git a/src/fnpjs/logging/handlers.js b/src/fnpjs/logging/handlers.js index f6f0509..a85645a 100644 --- a/src/fnpjs/logging/handlers.js +++ b/src/fnpjs/logging/handlers.js @@ -6,10 +6,19 @@ define(function() { return { console: function(record) { /* global console */ - var method; + var level = record.level, + method, msg; if(console) { - method = (typeof console[record.level] === 'function') ? record.level : 'log'; - console[method](record.message); + if(level === 'warning') { + level = 'warn'; + } + method = (typeof console[level] === 'function') ? level : 'log'; + if(record.data && record.data.exception && record.data.exception.stack) { + msg = record.data.exception.stack; + } else { + msg = record.message; + } + console[method](msg); } }, raven: function(record) {