Last modified: 2013-03-22 14:23:11 UTC
I find the total lack of mw.log usage quite surprising. I suspect the reason may be that it takes up javascript space in production, which - given that it is a no-op in production mode - is understandable. Enabling logging output in PHP gives one quite a useful trace of the general proces from initialization to handling of the request, building response, etc.. But in JavaScript there is practically zero 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, or the reverse, to make them into javascript in debug mode)? The parser in JavaScriptMinifier seems an attractive place to implement something like this (whether or not through a hook[1]). [1] This wouldn't be a MWHook, since it is a standalone library. But a basic this may do: JavaaScriptMinifier::addHook('comments', array( $rl, 'enableJSDebugLogging') ); ResourceLoader { public function enableJSDebugLogging( $context, // array( file =>, line => ) $block // '/* .. \n * @log mw.log("foo", x, y) \n **/' ) {} }