I'm using firebug and making lots of console.log, .info, .dir calls, etc. When the app runs on a machine with firebug turned off, it can cause errors. What's the best technique to avoid that? This seems to work:
// global scope
if (typeof(console) == 'undefined') {
console = {
info : function() {},
dir : function() {},
error : function() {},
log : function() {}
};
}
but I don't like the idea of manually maintaining a list of console functions. Other ideas?
(We've also got jQuery on the project if that helps.)