Skip to content
This repository has been archived by the owner. It is now read-only.

Remove console.log.bind(console) pattern in log.js #4225

Closed
bgrins opened this issue Mar 14, 2018 · 1 comment
Closed

Remove console.log.bind(console) pattern in log.js #4225

bgrins opened this issue Mar 14, 2018 · 1 comment

Comments

@bgrins
Copy link

@bgrins bgrins commented Mar 14, 2018

I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1445772 to handle other cases in m-c. We don't need to manually bind console methods to the console object anymore as of Bug
989619.

So we should be able to simplify these:

if (shouldLog.debug) {
exports.debug = console.debug.bind(console);
}
if (shouldLog.info) {
exports.info = console.info.bind(console);
}
if (shouldLog.warn) {
exports.warn = console.warn.bind(console);
}
if (shouldLog.error) {
exports.error = console.error.bind(console);
}
to exports.debug = console.debug, etc.

@bgrins
Copy link
Author

@bgrins bgrins commented Mar 14, 2018

Also, Console.jsm is imported but doesn't seem to be used:

ChromeUtils.defineModuleGetter(this, "Console",
"resource://gre/modules/Console.jsm");
. Removing that reference will help with Console.jsm removal (https://bugzilla.mozilla.org/show_bug.cgi?id=1430810)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants