X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/7723bc8892a423d246035a0d7449193193fc5c8a..d721cbe5947c8bc75b2e4b0e9602e0e3d45dbbcb:/src/fnpjs/logging/handlers.js?ds=inline diff --git a/src/fnpjs/logging/handlers.js b/src/fnpjs/logging/handlers.js index c5b6990..cc2eab1 100644 --- a/src/fnpjs/logging/handlers.js +++ b/src/fnpjs/logging/handlers.js @@ -10,16 +10,21 @@ return { return; } - var ravenData = {}; + var ravenData = { + level: record.level, + logger: record.loggerName, + tags: {} + }; + + Object.keys(record.data || {}) + .filter(function(key) {return key !== 'exception';}) + .forEach(function(key) { + ravenData.tags[key] = record.data[key]; + }); if(record.data.exception) { - window.Raven.captureException(record.data.exception); + window.Raven.captureException(record.data.exception, ravenData); } else { - Object.keys(record.data || {}).forEach(function(key) { - ravenData[key] = record.data[key]; - }); - ravenData.tags = ravenData.tags || {}; - ravenData.tags.level = record.level; window.Raven.captureMessage(record.message, ravenData); } }