resourceloader: Require logName parameter in mw.log.deprecate()
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 9 Feb 2019 01:36:13 +0000 (01:36 +0000)
committerKrinkle <krinklemail@gmail.com>
Sat, 9 Feb 2019 01:48:42 +0000 (01:48 +0000)
commitb35d7cfe89ae8b7e708981f98bb003b50cb70e9e
treea88ce9e3b334cdfd413620c62b6ca4ced5757bf7
parentcb73d93711b94bc3e174bad296a64205999fa67d
resourceloader: Require logName parameter in mw.log.deprecate()

When omitted it, it previously defaulted to the key string, which
would automatically lead to the creation of confusing and
non-descript Graphite metrics. (Via the WikimediaEvents extension
via the 'mw.deprecate' tracking topic.)

If Graphite tracking is intended, require the logName parameter
to be set. For example, in wikibits, a deprecated 'write' method
is set on the 'document' object. Its Graphite property under
mw/js/deprecate/ will be document_write because logName is set.
Without logName, it would previously create 'mw/js/deprecate/write'
as metric, which easily clashes and is not very understandable
in Grafana.

An exception is kept for properties of the window object as their
fully-qualified property name would always be identical due to
them being available as global variables.

Change-Id: I9d99fe0395ec5309eac0895f2419f7cd16caeb94
resources/src/startup/mediawiki.js