Page MenuHomePhabricator

Add wfDebug of loaded modules
Closed, DeclinedPublic

Description

It would be helpful for developers to easily see what resources are being loaded on a page request. Adding wfDebug() with the loaded JS/CSS files would be very helpful :)


Version: unspecified
Severity: enhancement

Details

Reference
bz25153

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 11:18 PM
bzimport set Reference to bz25153.

(In reply to comment #0)

It would be helpful for developers to easily see what resources are being
loaded on a page request. Adding wfDebug() with the loaded JS/CSS files would
be very helpful :)

How does this show things that are not obvious from looking at the AJAX requests in Firebug's Console or Net panel?

I suppose it doesn't really, I just figured a single line in the debug log like

"ResourceLoader, loaded: jquery, jquery.ui, mediawiki.legacy.ajax"

Might be handy. Go ahead and WONTFIX if you don't think so :)

Marking WONTFIX as this seems something for client side rather than server side.

In the client side you can set url-parameter debug=true (or enforce it via $$wgResourceLoaderDebug i LocalSettings.php) at which points debug calls to mw.log() will be outputted to a #mw-log-console (or your native JS Console if you have one).

We should add mw.log() calls to the core modules to indicate when stuff is loaded.

I've made a start in r83658. It not only logs when a module fails but also if and when a module is loaded at all and which state it is set to.

It does it for all default modules except for special modules like startup, site and user. But that's just a matter of adding a line like:

mw.log( 'Site module loaded' );

etc.