X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/27ae526d5467db76208193e2aa1e80ad69d164d4..4b866f317d1e2e774e55127ba6bf598d61b363d8:/src/fnpjs/logging/handlers.js?ds=sidebyside diff --git a/src/fnpjs/logging/handlers.js b/src/fnpjs/logging/handlers.js index cc2eab1..f6f0509 100644 --- a/src/fnpjs/logging/handlers.js +++ b/src/fnpjs/logging/handlers.js @@ -4,6 +4,14 @@ define(function() { return { + console: function(record) { + /* global console */ + var method; + if(console) { + method = (typeof console[record.level] === 'function') ? record.level : 'log'; + console[method](record.message); + } + }, raven: function(record) { /* global window */ if(!window.Raven) { @@ -22,7 +30,7 @@ return { ravenData.tags[key] = record.data[key]; }); - if(record.data.exception) { + if(record.data && record.data.exception) { window.Raven.captureException(record.data.exception, ravenData); } else { window.Raven.captureMessage(record.message, ravenData);