Remove createEnterpriseLogger so enterprise consoles pass the mozilla/valid-log-module ESLint rule
Categories
(Enterprise Products :: Firefox, task)
Tracking
(Not tracked)
People
(Reporter: jporter, Assigned: jporter)
References
(Depends on 1 open bug)
Details
Bug 2086992 adds the mozilla/valid-log-module ESLint rule and turns it on as an error in the recommended config. The rule requires the logModule given to console.createInstance to be a string literal written in the call, so that every MOZ_LOG module can be checked and listed from the source.
All enterprise and FELT modules create their console through createEnterpriseLogger(logModule) in EnterpriseCommon.sys.mjs. That helper passes logModule through a variable, so the rule reports logModuleNotLiteral, and lint will fail once the rule reaches enterprise-main. Changing the helper's signature can't fix this. The rule's documentation also asks not to work around it.
Upstream is removing helpers like this in the same stack (e.g. LoginHelper.createLogger and GeckoViewUtils.initLoggingConsole). We should do the same.. call console.createInstance directly with a literal logModule and maxLogLevelPref: "enterprise.log_level" at each of the 24 call sites, then delete createEnterpriseLogger and ENTERPRISE_LOG_LEVEL_PREF from EnterpriseCommon.sys.mjs.
Description
•