Closed Bug 1378480 Opened 7 years ago Closed 7 years ago

Pipe Browser Toolbox stdout and stderr to terminal

Categories

(DevTools :: Framework, enhancement)

enhancement
Not set
normal

Tracking

(firefox56 fixed)

RESOLVED FIXED
Firefox 56
Tracking Status
firefox56 --- fixed

People

(Reporter: jryans, Assigned: jryans)

References

Details

Attachments

(1 file)

We should pipe the Browser Toolbox process' stdout and stderr up to the parent, so that it reaches the developer's terminal (if there is one). This should ease finding problems like bug 1377326.
Assignee: nobody → jryans
Status: NEW → ASSIGNED
Comment on attachment 8883690 [details] Bug 1378480 - Dump Browser Toolbox stdout to terminal. https://reviewboard.mozilla.org/r/154600/#review159682 I was actually planning to add a Subprocess option to just let the process inherit stdout for this, but I guess this is fine in the mean time. ::: devtools/client/framework/ToolboxProcess.jsm:283 (Diff revision 1) > > dumpn("Chrome toolbox is now running..."); > this.emit("run", this); > > proc.stdin.close(); > + let dumpPipe = async function (pipe) { Nit: No need for `let`. Just `async function dumpPipe(pipe)` or, if you do use `let`, `let dumpPipe = async pipe => { ... }` ::: devtools/client/framework/ToolboxProcess.jsm:284 (Diff revision 1) > + let data = await pipe.readString(); > + while (data) { > + dump(data); > + data = await pipe.readString(); > + } I generally prefer something like: let data; while ((data = await pipe.readString())) { dump(data); } but I guess it's fine either way.
Attachment #8883690 - Flags: review?(kmaglione+bmo) → review+
(In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #0) > We should pipe the Browser Toolbox process' stdout and stderr up to the > parent, so that it reaches the developer's terminal (if there is one). > > This should ease finding problems like bug 1377326. Note that that problem started before we switched to Subprocess, when the browser toolbox still automatically inherited stdout and stderr, but no-one seemed to notice it until it caused problems.
(In reply to Kris Maglione [:kmag] from comment #4) > (In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #0) > > We should pipe the Browser Toolbox process' stdout and stderr up to the > > parent, so that it reaches the developer's terminal (if there is one). > > > > This should ease finding problems like bug 1377326. > > Note that that problem started before we switched to Subprocess, when the > browser toolbox still automatically inherited stdout and stderr, but no-one > seemed to notice it until it caused problems. Yeah, it's definitely not a guarantee that action is taken... but it at least makes it a bit easier!
Comment on attachment 8883690 [details] Bug 1378480 - Dump Browser Toolbox stdout to terminal. https://reviewboard.mozilla.org/r/154600/#review159682 > Nit: No need for `let`. Just `async function dumpPipe(pipe)` or, if you do use `let`, `let dumpPipe = async pipe => { ... }` Thanks, didn't realize async and arrow funcs could be combined. > I generally prefer something like: > > let data; > while ((data = await pipe.readString())) { > dump(data); > } > > but I guess it's fine either way. Haha, actually I started with that, but DevTools ESLint rules currently disapprove of assignment in loop conditions.
Pushed by jryans@gmail.com: https://hg.mozilla.org/integration/autoland/rev/fd669d55812d Dump Browser Toolbox stdout to terminal. r=kmag
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 56
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: