Closed Bug 857607 Opened 7 years ago Closed 7 years ago

Reduce log level when launching B2G desktop client with mozrunner

Categories

(Testing :: Mozbase, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(firefox22 wontfix, firefox23 fixed, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 fixed)

RESOLVED FIXED
mozilla23
Tracking Status
firefox22 --- wontfix
firefox23 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- fixed

People

(Reporter: davehunt, Assigned: davehunt)

References

Details

Attachments

(1 file, 1 obsolete file)

When launching B2G desktop client using mozrunner, there is an excessive amount of logging output to the console. Most of this appears to be related to Marionette. When using this in combination with running tests, it's very difficult to see the test results in the console.

The following is just what's generated during launch. If tests are running it appears that all Marionette logs are output to the console.

$ mozrunner --binary=/Users/dhunt/Desktop/mozilla-b2g18/B2G.app
Starting: /Users/dhunt/Desktop/mozilla-b2g18/B2G.app/Contents/MacOS/b2g -profile /var/folders/5_/9gz0dv9s51q2shxc8hg62j200000gn/T/tmpeHyBdR.mozrunner
Starting b2g-bin
Running: /Users/dhunt/Desktop/mozilla-b2g18/B2G.app/Contents/MacOS/b2g-bin -profile /Users/dhunt/Desktop/mozilla-b2g18/B2G.app/Contents/MacOS/gaia/profile
1365002735841	Marionette	INFO	MarionetteComponent loaded
1365002735843	Marionette	INFO	marionette enabled
1365002735875	Marionette	INFO	marionette initializing at final-ui-startup
###################################### forms.js loaded
############################### browserElementPanning.js loaded
######################## BrowserElementChildPreload.js loaded
[AccessFu] INFO attach
###################################### forms.js loaded
############################### browserElementPanning.js loaded
######################## BrowserElementChildPreload.js loaded
XXX FIXME : Got a mozContentEvent: system-message-listener-ready
XXX FIXME : Got a mozContentEvent: accessibility-screenreader
###################################### forms.js loaded
############################### browserElementPanning.js loaded
######################## BrowserElementChildPreload.js loaded
###################################### forms.js loaded
############################### browserElementPanning.js loaded
######################## BrowserElementChildPreload.js loaded
Blocks: 857622
Jonathan: Any ideas how I might reduce this log level when launching via mozrunner?
Flags: needinfo?(jgriffin)
This is all stdout spew from the B2G process, which is printed to stdout by default by mozprocess' ProcessHandler:  https://github.com/mozilla/mozbase/blob/master/mozprocess/mozprocess/processhandler.py#L832

If you want to get rid of it, you could create a subclass of ProcessHandler that defines processOutputLine so you avoid the default stdout dump, and then pass this new class as the process_class kwarg in mozrunner's ctor.
Flags: needinfo?(jgriffin)
Thanks for the info, based on this I was able to pass a 'processOutputLine' argument with an object that will basically ignore all output passed to it. I'm not sure if this is the best approach, but it does work well for me. Could you provide feedback?
Assignee: nobody → dave.hunt
Attachment #735664 - Flags: feedback?(jgriffin)
Comment on attachment 735664 [details] [diff] [review]
Redirect process output to null. v1.0

Review of attachment 735664 [details] [diff] [review]:
-----------------------------------------------------------------

I think this is generally the right approach, but I worry about ignoring all the output.  When debugging test failures, having access to the output would likely sometimes be useful.  We may want to write all the output to a file that could be examined later at leisure.
Attachment #735664 - Flags: feedback?(jgriffin) → feedback+
If we pass 'logfile' in kp_kwargs then this will be written to file. I could write to simply 'gecko.log' unless you have some other suggestion?
Flags: needinfo?(jgriffin)
sounds reasonable
Flags: needinfo?(jgriffin)
Attachment #735664 - Attachment is obsolete: true
Attachment #738020 - Flags: review?(jgriffin)
Comment on attachment 738020 [details] [diff] [review]
Redirect process output to null and append to log file. v2.0

Review of attachment 738020 [details] [diff] [review]:
-----------------------------------------------------------------

Eventually we may want a command-line arg to specify the logfile name, but this is fine for now, we can add that later if it turns out to be needed.
Attachment #738020 - Flags: review?(jgriffin) → review+
https://hg.mozilla.org/mozilla-central/rev/dbc28a463297
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.