Which solution do you recommend, the second is simpler ( less code ), but there are drawbacks on using it ?
First: (Set a global debug flag)
Or, in coffeescript:
window.console ?= log:-> #patch so console.log() never causes error even in IE.