PSA: Lint will now reject new uses of Console.sys.mjs and Log.sys.mjs

162 views
Skip to first unread message

Mark Banner

unread,
Jan 16, 2024, 4:27:43 PMJan 16
to firefox-dev list, dev-pl...@mozilla.org

For a long time now we have had the desire to improve our logging story, especially from JavaScript.

Currently we have three different methods of module-style logging in JavaScript code: Log.sys.mjs, Console.sys.mjs and console.createInstance. We need to consolidate these to remove the complexity and make it easier for the next steps.

Today we are taking the first steps - I am landing a patch that will raise ESLint errors on new instances of Log.sys.mjs and Console.sys.mjs being used. This is intended to stop us adding new instances where we don't need to.

The first part of the current plan is to resolve differences between Console.sys.mjs and console.createInstance and then remove Console.sys.mjs.

Log.sys.mjs replacement will need more investigation as it has some additional functionality that may not be available in the current console.createInstance.

Mark.
Reply all
Reply to author
Forward
0 new messages