how can I override console.log() and prepend a word at the beginning of the output?
Solution 1:
You can override the console.log
easily
(function(){
if(window.console && console.log){
var old = console.log;
console.log = function(){
Array.prototype.unshift.call(arguments, 'Report: ');
old.apply(this, arguments)
}
}
})();
console.log('test')
Demo: Fiddle