fb = { habilitado : true } fb.setLog = function(msg){ if(this.habilitado){ if(typeof(console)!='undefined')console.log(msg); } } fb.setDebug = function(obj){ if(this.habilitado){ if(typeof(console)!='undefined')console.debug(obj); } } fb.logEventoRegistrado = function(elemento, evento, funcao){ if(this.habilitado){ if(typeof(console)!='undefined'){ console.groupCollapsed('Evento('+evento+') registrado para o elemento #'+elemento); console.debug(document.getElementById(elemento)); console.log('Função chamada no evento: '+funcao); console.groupEnd(); } } }