diff --git a/app/initializers/rollbar.js b/app/initializers/rollbar.js index 6db6f72..a118fa7 100644 --- a/app/initializers/rollbar.js +++ b/app/initializers/rollbar.js @@ -4,37 +4,39 @@ import Ember from 'ember'; export default { name: 'rollbar', initialize: function() { - var errorLogger = Ember.Logger.error; - Ember.Logger.error = function() { - var args = Array.prototype.slice.call(arguments), + if (typeof FastBoot === 'undefined') { + var errorLogger = Ember.Logger.error; + Ember.Logger.error = function() { + var args = Array.prototype.slice.call(arguments), err = isError(args[0]) ? args[0] : new Error(stringify(args)); - if (window.Rollbar) { - Rollbar.error.call(Rollbar, err); - } - errorLogger.apply(this, arguments); - }; - var warnLogger = Ember.Logger.warn; - Ember.Logger.warn = function() { - if (window.Rollbar) { - Rollbar.warning.apply(Rollbar, arguments); - } - warnLogger.apply(this, arguments); - }; - var infoLogger = Ember.Logger.info; - Ember.Logger.info = function() { - if (window.Rollbar) { - Rollbar.info.apply(Rollbar, arguments); - } - infoLogger.apply(this, arguments); - }; - var debugLogger = Ember.Logger.debug; - Ember.Logger.debug = function() { - if (window.Rollbar) { - Rollbar.debug.apply(Rollbar, arguments); - } - debugLogger.apply(this, arguments); - }; + if (window.Rollbar) { + Rollbar.error.call(Rollbar, err); + } + errorLogger.apply(this, arguments); + }; + var warnLogger = Ember.Logger.warn; + Ember.Logger.warn = function() { + if (window.Rollbar) { + Rollbar.warning.apply(Rollbar, arguments); + } + warnLogger.apply(this, arguments); + }; + var infoLogger = Ember.Logger.info; + Ember.Logger.info = function() { + if (window.Rollbar) { + Rollbar.info.apply(Rollbar, arguments); + } + infoLogger.apply(this, arguments); + }; + var debugLogger = Ember.Logger.debug; + Ember.Logger.debug = function() { + if (window.Rollbar) { + Rollbar.debug.apply(Rollbar, arguments); + } + debugLogger.apply(this, arguments); + }; + } } };