Closed
Bug 1138336
Opened 9 years ago
Closed 9 years ago
Adapt nsIScriptError so it can display log messages with filename and line number
Categories
(Toolkit Graveyard :: Error Console, enhancement)
Toolkit Graveyard
Error Console
Tracking
(firefox40 fixed)
RESOLVED
FIXED
mozilla40
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: darktrojan, Assigned: darktrojan)
Details
Attachments
(1 file, 1 obsolete file)
7.08 KB,
patch
|
neil
:
review+
past
:
review+
|
Details | Diff | Splinter Review |
(I really don't know if this is the right component but it'll do.) It should be easy to post log messages with file and line number information attached. nsIScriptError is perfect for this but it only handles errors and warnings. With this patch I add a new flag to nsIScriptError for info messages, and adapt the old and new consoles to display them correctly. I'm going to need review from XPConnect, DevTools and Toolkit teams, but first up I'll ask for review on the XPConnect parts since that's most critical.
Attachment #8571236 -
Flags: review?(jst)
Comment 1•9 years ago
|
||
Comment on attachment 8571236 [details] [diff] [review] logmessage-1.diff r=jst for the xpconnect bits.
Attachment #8571236 -
Flags: review?(jst) → review+
Assignee | ||
Comment 2•9 years ago
|
||
Comment on attachment 8571236 [details] [diff] [review] logmessage-1.diff Neil, please review the toolkit/components/console changes. While I was there I noticed that this part only works because warningFlag is 1. Good job it's never been changed. :) > var warning = aObject.flags & nsIScriptError.warningFlag != 0;
Attachment #8571236 -
Flags: review?(neil)
Comment 3•9 years ago
|
||
(In reply to Geoff Lankow from comment #2) > While I was there I noticed that this part only works because warningFlag is > 1. Good job it's never been changed. :) > > > var warning = aObject.flags & nsIScriptError.warningFlag != 0; Wow. I did some CVS archaeology. The line var warning = scriptError.flags & nsIScriptError.WARNING != 0; was originally checked in on 2000-03-21 as version 1.4 of console.js and has since been searched and replaced and copied and pasted sevceral times before getting to where you see it.
Comment 4•9 years ago
|
||
Comment on attachment 8571236 [details] [diff] [review] logmessage-1.diff > .console-row[type="error"], >-.console-row[type="warning"] { >+.console-row[type="warning"], >+.console-row[type="message"] { > -moz-binding: url("chrome://global/content/consoleBindings.xml#error"); > } > >-.console-row[type="message"] { >+.console-row[type="message"]:not([href]) { > -moz-binding: url("chrome://global/content/consoleBindings.xml#message"); > } Would it work to use .console-row[type="message"][href] in the first block (which would make it more specific, or you could exchange the rules if you prefer)? (Any particular reason you chose href anyway?) >- var warning = aObject.flags & nsIScriptError.warningFlag != 0; >+ var message = !!(aObject.flags & nsIScriptError.infoFlag); >+ var warning = !!(aObject.flags & nsIScriptError.warningFlag); > >- var typetext = warning ? "typeWarning" : "typeError"; >+ var typetext = message ? "typeMessage" : (warning ? "typeWarning" : "typeError"); > row.setAttribute("typetext", this.mStrBundle.getString(typetext)); >- row.setAttribute("type", warning ? "warning" : "error"); >+ row.setAttribute("type", message ? "message" : (warning ? "warning" : "error")); Would it make sense to start using the logLevel instead of these nested ternary operators?
Assignee | ||
Comment 5•9 years ago
|
||
Ugh, looks like I never tidied up after doing the minimum required to make it work. This looks prettier.
Attachment #8571236 -
Attachment is obsolete: true
Attachment #8571236 -
Flags: review?(neil)
Attachment #8573017 -
Flags: review?(neil)
Updated•9 years ago
|
Attachment #8573017 -
Flags: review?(neil) → review+
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8573017 [details] [diff] [review] logmessage-2.diff Mihai, review on the devtools bits please.
Attachment #8573017 -
Flags: review?(mihai.sucan)
Updated•9 years ago
|
Attachment #8573017 -
Flags: review?(mihai.sucan) → review?(past)
Comment 7•9 years ago
|
||
Comment on attachment 8573017 [details] [diff] [review] logmessage-2.diff Review of attachment 8573017 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me.
Attachment #8573017 -
Flags: review?(past) → review+
Assignee | ||
Comment 8•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/52c23bbb3009
Comment 9•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/52c23bbb3009
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Updated•8 years ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•