Is there a method I can override on a JavaScript object to control what is displayed by console.log?
There's no way I know of. Your best bet will be to define a toString()
method on the object you want to log and then call it, either directly or indirectly:
var o = {};
o.toString = function() {
return "Three blind mice";
};
console.log("" + o);
console.log(o.toString());