Witch solution do you recomend, the second is simpler ( less code ), but there are drawbacks on using it ?
first: (set a global debug flag)
// the first line of code
var debug = true;
try
{
console.log
}catch(e)
{
if(e){
debug=false;
}
};
// then latter in the code
if(debug)
{
console.log(something);
}
second: override console.log
try
{
console.log
}catch(e)
{
if(e)
{
console.log = function() {}
}
};
// and all you need tot do in the code is
console.log(something);
Thank you