I\'ve written up an application that uses Ember Data. It\'s passing all it\'s tests and running as expected, however, something is causing a repeated deprecation warning to
My suggestion here, so you won't completely miss the deprecation warnings - they're there for a reason, right?
These are simplified versions of what deprecate
would do, but logging to DEBUG (so you can filter them out easily) and without the stacktrace (for simplicity). They'll also not show repeated messages:
CoffeeScript:
Ember.deprecate = (->
already_shown = []
(msg, test, opt)->
return false if test
if already_shown.indexOf(msg) == -1
warning = "DEPRECATION: #{msg}"
warning += " See: #{opt.url}" if opt.url
console.debug warning
already_shown.push msg
)()
JS:
Ember.deprecate = (function() {
var already_shown = [];
return function (msg, test, opt) {
if (test) return false;
if (already_shown.indexOf(msg) === -1) {
var warning = 'DEPRECATION: ' + msg;
if (opt.url) {
warning += ' See: ' + opt.url;
}
console.debug(warning);
}
already_shown.push(msg);
};
})();