mediawiki.log.js: Add support for variadic arguments (just like the native console...
authorKrinkle <krinkle@users.mediawiki.org>
Sat, 10 Sep 2011 22:29:57 +0000 (22:29 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Sat, 10 Sep 2011 22:29:57 +0000 (22:29 +0000)
commit51054551b5e3b6e1eb388cefaba16674133dde44
treea99405ccdc5191dd495f53224166c25c047681ca
parent0b117dc5065b381496f0d1d958752b1935117c7b
mediawiki.log.js: Add support for variadic arguments (just like the native console does)
* Use unshift() when calling window.console.log (that way logging an object will not result in "prefix> [object Object]" but in "prefix> { key: .., .. }" (which most consoles do, similar thing for logging elements for which most console API implementations offer special features)
* Use string concatenation when using our own fabricated log. Did not use unshift for both, because in the latter that would show a bad comma ("prefix:>, foo, bar"). The native API does not show a comma between two logged variables, they're just shown next to each other.
resources/mediawiki/mediawiki.log.js