Closed
Bug 1191571
Opened 10 years ago
Closed 7 years ago
Console.jsm should wrap the WebIDL console
Categories
(DevTools :: General, defect)
DevTools
General
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1425574
People
(Reporter: fitzgen, Unassigned)
References
Details
Attachments
(4 files, 2 obsolete files)
8.09 KB,
patch
|
Details | Diff | Splinter Review | |
28.08 KB,
patch
|
Details | Diff | Splinter Review | |
5.40 KB,
patch
|
Details | Diff | Splinter Review | |
2.12 KB,
patch
|
Details | Diff | Splinter Review |
It is so annoying not having the real console. No time/timeEnd and a bunch of other methods.
Let's kill it from devtools and use the Real Thing.
Reporter | ||
Updated•10 years ago
|
Assignee: nobody → nfitzgerald
Status: NEW → ASSIGNED
Brian has previous argued[1] that we should use Console.jsm more, as it can offer a more configurable logging environment.
Maybe we need more discussion here first?
[1]: https://groups.google.com/d/msg/mozilla.dev.developer-tools/9plcJGyRdP4/SqilxCL0Jy8J
Flags: needinfo?(bgrinstead)
Reporter | ||
Comment 2•10 years ago
|
||
I'm not going to fully remove Console.jsm here because:
1) The addon-sdk seems to depend on it and its funkiness pretty heavily, and
2) There are a few tests that seem to depend on the funkiness of Console.jsm as well.
This work will however make bug 988636 a lot easier.
Reporter | ||
Comment 3•10 years ago
|
||
Reporter | ||
Comment 4•10 years ago
|
||
Reporter | ||
Comment 5•10 years ago
|
||
This removes the usage of the Console.jsm's console as a generic console in
devtools. There are a few uses of Console.jsm still in toolkit/devtools, but
they are more specialized edge cases. Examples include tests for Console.jsm,
webconsole tests that want pretty output to stdout for tbpl logs, etc.
Reporter | ||
Comment 6•10 years ago
|
||
This removes most Console.jsm as a generic console usage from
browser/devtools. There were a few places that I didn't feel confident changing,
most seemed related to tests related Console.jsm and profiler interaction with
Console.jsm, etc.
Reporter | ||
Comment 7•10 years ago
|
||
(In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #1)
> Brian has previous argued[1] that we should use Console.jsm more, as it can
> offer a more configurable logging environment.
>
> Maybe we need more discussion here first?
>
> [1]:
> https://groups.google.com/d/msg/mozilla.dev.developer-tools/9plcJGyRdP4/
> SqilxCL0Jy8J
I will bring up discussion, but I don't think we need to block work here. I'm not removing Console.jsm, and this wouldn't inhibit work towards s/Console.jsm/DevToolsTracerThing.jsm.
Console.jsm is an inferior console compared to the webidl one, and is frequently inhibiting my debugging and profiling experience.
Whether it lives on as some custom devtools prefix logger doesn't make it a better console.
Reporter | ||
Updated•10 years ago
|
Attachment #8644033 -
Flags: review?(bobbyholley)
Reporter | ||
Updated•10 years ago
|
Attachment #8644034 -
Flags: review?(jryans)
Reporter | ||
Updated•10 years ago
|
Attachment #8644035 -
Flags: review?(jryans)
Reporter | ||
Updated•10 years ago
|
Attachment #8644036 -
Flags: review?(jryans)
Reporter | ||
Comment 8•10 years ago
|
||
+---------------+--------------------------+-------------+
| | WebIDL console | Console.jsm |
+---------------+--------------------------+-------------+
|assert | Yes | No |
|clear | Yes | Yes |
|count | Yes | No |
|debug | Yes | Yes |
|dir | Yes | Yes |
|dirxml | Yes | Yes |
|error | Yes | Yes |
|exception | Yes | Yes |
|group | Yes | Yes |
|groupCollapsed | Yes | No |
|groupEnd | Yes | Yes |
|info | Yes | Yes |
|log | Yes | Yes |
|markTimeline | Yes | Yes |
|profile | Yes | No |
|profileEnd | Yes | No |
|table | Yes | No |
|time | Yes | Yes* |
|timeEnd | Yes | Yes* |
|timeStamp | Yes | No |
|timeline | Yes | No |
|timelineEnd | Yes | No |
|trace | Yes | Yes |
|warn | Yes | Yes |
+---------------+--------------------------+-------------+
Yes* = the method is there but doesn't seem to work correctly and doesn't hook into the profiler's waterfall.
Reporter | ||
Comment 9•10 years ago
|
||
Additionally, group/groupEnd don't seem to work the same way they do on the WebIDL console; Console.jsm throws errors where the normal console does not.
Reporter | ||
Comment 10•10 years ago
|
||
Try push for these patches: https://treeherder.mozilla.org/#/jobs?repo=try&revision=854aa0b1c245
Reporter | ||
Comment 11•10 years ago
|
||
Additionally, Console.jsm does not support printf style %s substitutions.
Reporter | ||
Comment 12•10 years ago
|
||
Attachment #8644033 -
Attachment is obsolete: true
Attachment #8644033 -
Flags: review?(bobbyholley)
Reporter | ||
Comment 13•10 years ago
|
||
Attachment #8644034 -
Attachment is obsolete: true
Attachment #8644034 -
Flags: review?(jryans)
Reporter | ||
Comment 14•10 years ago
|
||
Comment 15•10 years ago
|
||
part 0 needs tests.
Reporter | ||
Comment 16•10 years ago
|
||
Ok, so after talking to devtools people, we are going to make Console.jsm wrap the WebIDL console as an easy way to preserve Console.jsm's prefix support and dumping to stdout.
Summary: Stop using Console.jsm in devtools → Console.jsm should wrap the WebIDL console
Comment on attachment 8644035 [details] [diff] [review]
Part 2: Remove most Console.jsm usage from toolkit/devtools
Canceling review per recent discussions until there's an updated version.
Attachment #8644035 -
Flags: review?(jryans)
Attachment #8644036 -
Flags: review?(jryans)
Comment 18•10 years ago
|
||
(In reply to Nick Fitzgerald [:fitzgen][:nf] from comment #16)
> Ok, so after talking to devtools people, we are going to make Console.jsm
> wrap the WebIDL console as an easy way to preserve Console.jsm's prefix
> support and dumping to stdout.
I'm in favor of that plan
Flags: needinfo?(bgrinstead)
Reporter | ||
Comment 19•10 years ago
|
||
Ok so even if we wrap the WebIDL console, time/timeEnd don't properly create markers for the waterfall. In fact it crashes because the console assumes that if we don't have mWindow, then we must be in a worker. So I started fixing that, and then got deep into refactoring the way that global markers work.
In the end, there are too many things to do here before we can move forward and I don't have the time. I was hoping this would be relatively short and sweet, but it is clear to me now that it is not that.
Assignee: nfitzgerald → nobody
Status: ASSIGNED → NEW
Comment 20•7 years ago
|
||
I have a better approach that wrapping Console API in console.jsm: in bug 1425463, I wrote a set of patches that allows JSM code to use Console API directly. It also introduces prefix, dump function, console ID and all the features that Console.jsm currently has.
Updated•7 years ago
|
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•