Browse Source

Do not spam console per default.

pull/28/head
Simon Eisenmann 11 years ago
parent
commit
feee1d3d76
  1. 21
      static/js/main.js

21
static/js/main.js

@ -118,6 +118,27 @@ require.config({ @@ -118,6 +118,27 @@ require.config({
}
});
(function() {
var debugDefault = window.location.href.match(/(\?|&)debug($|&|=)/);
// Overwrite console to not log stuff per default.
// Write debug(true) in console to enable or start with ?debug parameter.
window.consoleBackup = window.console;
window.debug = function(flag) {
if (!flag) {
window.console = {
log: function() {},
info: function() {},
warn: function() {},
error: function() {},
trace: function() {}
}
} else {
window.console = consoleBackup;
}
};
window.debug(debugDefault && true);
}());
require.onError = (function() {
var retrying = false;
return function(err) {

Loading…
Cancel
Save