I find the total lack of mw.log usage surprising. I suspect the reason may be that it takes up space/bandwidth, which - given that it is a no-op in production mode - is understandable.
Enabling logging output in PHP gives one a useful trace of the general process from initialization to handling of the request, building response, etc..
But in JavaScript there is practically no logging output in debug mode. The only output to the console is from the local log() function in mediawiki.js in case of module errors.
Perhaps we can find a way to filter them out in production mode? (Either in minification or some post-processor.)
The parser in JavaScriptMinifier seems an attractive place to implement something like this (whether or not through a hook[1]).
[1] Not an MWHook, as it's a standalone library. But this may work:
JavaScriptMinifier::addHook('comments', array( $rl, 'enableJSDebugLogging') ); ResourceLoader { public function enableJSDebugLogging( $context, // array( file =>, line => ) $block // '/* .. \n * @log mw.log("foo", x, y) \n **/' ) { /* Replace comment with function call in debug mode. */ } }