There is also the issue of turning the logs on/off. I've come to like the ability to use android properties, since you can manipulate them from the adb shell command line using getprop/setprop.
Using preferences is nice on the desktop, because we have a UI that can be used to control them. That same UI is currently unavailable on the phone. The only reason I would use mozSettings is if I wanted some gaia UI to be able to control things. We already have code to allow changes in a mozSetting to update a preference and vice-versa. I'd like to propose that we allow properties to also be updated/have changes reflected in preferences as well. The reason console.log has issues is that console.log requests made by a child are passed via IPC to the parent, and then they're logged. With dump() the call to the android logger happens in the child. linux has an interesting approach to system logging. Everybody uses syslog, and then there is a configuration file/daemon that takes care of actually distributing the log data. On the phone, logcat already takes care of the hard part. We just need to be a bit more clever about integrating things. Right now, all dump calls come out tagged as "Gecko". It probably makes sense to tag dump statements from an app using the app name. Then you'd be able to filter your logcat output and just get dumps from a particular app. You can get some very interesting logcat filters. I have a script that automatically does: adb logcat -v threadtime memalloc:I ONCRPC:S HWComposer:S Diag_Lib:S QCALOG:S QCRIL_RPC:S EventHub:I OMX.google.mp3.decoder:V You can add logging categories with :S to silence a particular category (or use *:S to silence everything) and then add back stuff you're interested in. Run adb logcat -h to get full details on filterspecs. If we want the ability to put the logging data off-device, then it probably makes sense to have a daemon that grabs data from logcat and sends it whereever it is that it needs to go. Dave Hylands ----- Original Message ----- > From: "Tim Chien" <[email protected]> > To: "Gabriele Svelto" <[email protected]> > Cc: "dev-b2g" <[email protected]>, "qa-b2g" <[email protected]>, > "Johnny Stenback" <[email protected]>, "Al Tsai" <[email protected]>, "James > Lal" <[email protected]>, "Jonas Sicking" <[email protected]> > Sent: Thursday, August 21, 2014 7:47:13 AM > Subject: Re: [b2g] Log collection needs improvement > On Thu, Aug 21, 2014 at 4:01 PM, Gabriele Svelto <[email protected]> wrote: > > On 21/08/2014 08:21, Tim Chien wrote: > >> Previously we had a creative invention from Frsela that turning on/off > >> a all-caps DUMP() function with mozSettings. I would love that being > >> formalized in Gecko. > >> https://github.com/mozilla-b2g/gaia/blob/master/shared/js/dump.js > > > > Standardizing all gaia applications on DUMP() would already be a big > > improvement even though the interface is currently very simple. Gecko > > has similar problems regarding logging with certain components being > > well made and others a total mess (often dumping output via 3/4 > > different unrelated methods). Also, the most common mechanism used in > > C++ code (PR_Log) is not available under chrome code and thus we > > normally resort to ad hoc logging solutions there (see the RIL component > > for example). > > > > Gabriele > > > Yeah, but that would mean every app need to read that mozSettings > value (and have the permission to access that) right? Plus log will > not appear during app start-up until the mozSettings get() returns > positive value. > I may be naive but I would really love that being done in Gecko... > -- > Tim Guan-tin Chien, Engineering Manager and Front-end Lead, Firefox > OS, Mozilla Corp. (Taiwan) > _______________________________________________ > dev-b2g mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-b2g
_______________________________________________ dev-b2g mailing list [email protected] https://lists.mozilla.org/listinfo/dev-b2g
