Added a debug switch (#debug) will output the console.log