//https://stackoverflow.com/a/30197438/7200161
var console=(function(defaultConsole){
	return {
		log: function(...text){
			if(State.variables.DEBUGGING)
				defaultConsole.log(...text);
		},
		info: function (...text) {
			if(State.variables.DEBUGGING)
				defaultConsole.info(...text);
		},
		warn: function (...text) {
			if(State.variables.DEBUGGING)
				defaultConsole.warn(...text);
		},
		error: function (...text) {
			if(State.variables.DEBUGGING)
				defaultConsole.error(...text);
		}
	};
}(window.console));

//Then redefine the old console
window.console = console;