- pass logger name
- pass level not as a tag (this overwrites default "level" tag value in
Sentry UI instead of setting its second value)
- allow for passing additional data when logging exception
+ 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) {
if(record.data.exception) {
- window.Raven.captureException(record.data.exception);
+ window.Raven.captureException(record.data.exception, ravenData);
- 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);
}
}
window.Raven.captureMessage(record.message, ravenData);
}
}