Cleanup leftover \n in console.error logs after migration from Cu.reportError
Categories
(Firefox :: General, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox116 | --- | fixed |
People
(Reporter: jdescottes, Assigned: standard8)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Eg "Warning: unrecognized command line flag " + curarg + "\n"
Which shows up as
console.error: "Warning: unrecognized command line flag -remote-allow-origins\n"
in stdout. I imagine this is a leftover from switching to console.error?
Mark: I can see that Cu.reportError was sometimes adding trailing \n. Do you know if this was intentional (eg the original version of the one I spotted here: https://searchfox.org/mozilla-central/rev/59f0cd13ab364ea4a5c4061c6c311691a9b1b01d/browser/components/BrowserContentHandler.sys.mjs#1171-1173)
| Assignee | ||
Comment 1•3 years ago
|
||
(In reply to Julian Descottes [:jdescottes] from comment #0)
Mark: I can see that Cu.reportError was sometimes adding trailing
\n. Do you know if this was intentional (eg the original version of the one I spotted here: https://searchfox.org/mozilla-central/rev/59f0cd13ab364ea4a5c4061c6c311691a9b1b01d/browser/components/BrowserContentHandler.sys.mjs#1171-1173)
I don't think that was intentional - looking further back at this diff shows that it was changed from dump (which doesn't automatically append newlines), to Cu.reportError, so I guess that has probably been broken for even longer and no-one has realised it. It could be that Cu.reportError automatically hid it, but either way, I think these are safe to tidy up now.
We should also split into multiple args rather than using string concatenation i.e. console.error("Warning: unrecognized command line flag", curarg);.
| Reporter | ||
Comment 2•3 years ago
|
||
Thanks for the feedback Mark! I will rename the bug for clarity.
| Reporter | ||
Updated•3 years ago
|
| Assignee | ||
Comment 3•3 years ago
|
||
To clarify, I don't think we replaced any of them with console.warn, so this applies to console.error only.
| Assignee | ||
Comment 4•3 years ago
|
||
This goes through the previous changes in the dependencies of bug 877389, and does two things:
- Remove instances of \n
- Change reporting of exceptions so that they are passed as separate arguments. This should result
in an improved display of the exception in the browser console, should it occur.
Updated•3 years ago
|
Comment 6•3 years ago
|
||
| bugherder | ||
Description
•