'console' is undefined - javascript error in logs

Problem is there are ~150 instances of console.log, probably ~100 of those are in external dependencies and I can’t tell which ones matter… looks like some of the dependencies set up custom handling for the console, e.g.

// Console
var console = window.console = {};
console.log = console.info = console.warn = console.error = function(){};

and

if ( typeof console !== "undefined" && typeof console.log !== "undefined" )
  console.log.apply( null, args );