Internal preference for logging RDP request/response packets
Categories
(DevTools :: Framework, enhancement, P4)
Tracking
(firefox153 fixed)
| Tracking | Status | |
|---|---|---|
| firefox153 | --- | fixed |
People
(Reporter: Harald, Assigned: ochameau, NeedInfo)
References
(Blocks 2 open bugs)
Details
User Story
When debugging devtools protocol communication flow, I want to see all the packets and inspect them in detail, so that I can understand which code is making requests and how they are handled.
Attachments
(6 files, 1 obsolete file)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
| Assignee | ||
Comment 1•6 years ago
|
||
We might reuse the existing preferences:
devtools.debugger.log devtools.debugger.log.verbose
https://searchfox.org/mozilla-central/search?q=devtools.debugger.log&path=
Which are mapped to flags.wantLogging:
https://searchfox.org/mozilla-central/search?q=wantLogging&case=true®exp=false&path=devtools
And flags.wantVerbose:
https://searchfox.org/mozilla-central/search?q=wantLogging&case=true®exp=false&path=devtools
Updated•3 years ago
|
| Assignee | ||
Comment 2•6 months ago
|
||
The RDP packets can still be logged via devtools.debugger.log preference
which turns the flags.wantLogging flag to true and enables the following logs:
https://searchfox.org/firefox-main/search?q=wantLogging&path=transport&case=true®exp=false
While devtools.debugger.log.verbose pref, enabled these other logs:
https://searchfox.org/firefox-main/search?q=wantLogging&path=transport&case=true®exp=false
These logs are imperfect, as I think they aren't necessarily logging both inbound and outbound packets.
The verbose helps see more information, but it is only interesting when you care about packet headers, which are super low level and not interesting when you care only about JSON objects.
These stdout logs only works if you also have browser.dom.window.dump.enabled preference set to true, which is a common puzzling issue on release builds where this pref is false (it is true on local builds).
It might be nice to move these logs to MOZ_LOG, the generic logging mechanism used in C++, but now also available in JS.
These is some documentation over here.
The overall idea would be to replace dump methods with:
const logger = console.createInstance({ prefix: "devtools_rdp" });
logger.log(rdpPacket); // Or stringify rdpPacket nicely if stdout logging of the JSON packet isn't nice with stdout logging
so that you can see more easily see the logs in stdout by running firefox like this:
$ MOZ_LOG=devtools_rdp:5 ./firefox (or ./mach run)
The benefits are that:
- you no longer need any preference to see the logs on stdout,
- you can easily control which logs you want to see from the command line,
- the logs can also be seen in the browser console/toolbox.
Working on this would be a nice step forward re-introducing a RDP inspector UI (UI to see all incoming/outcoming packets).
Updated•4 months ago
|
| Assignee | ||
Comment 3•4 months ago
|
||
Lorenz, some improvement recently landed around MOZ_LOG which makes comment 2 suggestion much more actionable.
Are you still interested in contributing something to help seeing RDP packets?
| Assignee | ||
Comment 4•1 month ago
|
||
RDP can be easily traced via stdout by running:
$ MOZ_LOG="devtools_rdp:5" ./mach run
| Assignee | ||
Comment 5•1 month ago
|
||
RDP can be easily traced via stdout by running:
$ MOZ_LOG="devtools_rdp:5" ./mach run
Updated•1 month ago
|
| Assignee | ||
Comment 6•1 month ago
|
||
| Assignee | ||
Comment 7•1 month ago
|
||
Also remove disabled/commented logging.
You may use "--env MOZ_LOG=devtools_rdp:5" to trace RDP packets on try runs.
Some tests are still toggling the old preference as they may want to
trace other usages of dumpn/dumpv.
| Assignee | ||
Comment 8•1 month ago
|
||
| Assignee | ||
Comment 9•1 month ago
|
||
This the last usage of "wantVerbose" flag.
| Assignee | ||
Comment 10•1 month ago
|
||
The transport layer was the only one using this.
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Comment 11•28 days ago
|
||
Comment 12•28 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/8eac666269fa
https://hg.mozilla.org/mozilla-central/rev/c5b50edc9155
https://hg.mozilla.org/mozilla-central/rev/33dd4f7f8e4c
https://hg.mozilla.org/mozilla-central/rev/4d8e40b8c487
https://hg.mozilla.org/mozilla-central/rev/a640941015ab
https://hg.mozilla.org/mozilla-central/rev/d3f55800bbc2
Description
•