return {
- raven: function(msg, level, data) {
+ raven: function(record) {
/* global window */
if(!window.Raven) {
return;
var ravenData = {};
- if(data.exception) {
- window.Raven.captureException(data.exception);
+ if(record.data.exception) {
+ window.Raven.captureException(record.data.exception);
} else {
- Object.keys(data || {}).forEach(function(key) {
- ravenData[key] = data[key];
+ Object.keys(record.data || {}).forEach(function(key) {
+ ravenData[key] = record.data[key];
});
ravenData.tags = ravenData.tags || {};
- ravenData.tags.level = level;
- window.Raven.captureMessage(msg, ravenData);
+ ravenData.tags.level = record.level;
+ window.Raven.captureMessage(record.message, ravenData);
}
}
};
}
if(levels.indexOf(handlerLevel) !== -1 && levels.indexOf(level) >= levels.indexOf(handlerLevel)) {
- handler(message, level, data);
+ handler({
+ message: message,
+ level: level,
+ loggerName: this.name,
+ data: data
+ });
}
- });
+ }.bind(this));
}
if(this.config.propagate && this.name) {
var logger = new Logger(this.name.split('.').slice(0, -1).join('.'));
};
// Loggin handler that just writes to the global logger object
-var testLoggingHandler = function(msg) {
- log.append(msg);
+var testLoggingHandler = function(record) {
+ log.append(record.message);
};
describe('Logging', function() {