Closed Bug 1841818 Opened 2 years ago Closed 1 year ago

Consider enabling MOZ_LOG logging in release and beta geckoview builds

Categories

(GeckoView :: General, task, P3)

All
Android
task

Tracking

(firefox129 fixed)

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: jnicol, Assigned: jnicol)

References

Details

(Whiteboard: [fxdroid])

Attachments

(1 file)

We previously disabled MOZ_LOG logging in release channels on Android in bug 1263197. The argument for doing so was that it reduced the binary size ~900kB, and that getting logs from Android users is difficult anyway, so having logging enabled is less valuable.

In bug 1840665 we had several engaged users who were competent enough to provide logs, but due to MOZ_LOG being disabled the logs were not particularily useful. Providing a custom build with logging enabled was difficult in this case, as we required the users' profiles to remain intact. And even after solving that problem the logging-enabled build did not work due to the nature of the bug (installing a new version of firefox reset bad state required to reproduce the bug).

Had these users been able to enable logging in the official Firefox build this would have been much simpler.

I have done a test build of current mozilla-release branch with logging re-enabled, and it increases the size of geckoview_example.apk by just over 1MB. Obviously this is significant. However, if the primary goal of keeping our binary size down is to stay beneath the google play store limit, and if we continue to enable logging on the Nightly channel which must also stay under that limit, is there much value in reducing the binary size only on the release and beta channels?

Note that as well as compiling in support for MOZ_LOG the user must also have a way of enabling logging. This can be done via a preference, environment variable, or about:logging. about:config is disabled in release builds, and there is no method of setting environment variables when launching the application. And for the bug in question, the user would have been unable to access about:logging as the browser was frozen. We therefore additionally must add a method for a user to enable the logs. This could be support for setting environment variables eg adb shell am start ... --es "env0" "MOZ_LOG=...", or via an option in the secret menu.

Priority: -- → P3

I think enable it on Nightly will be really helpful, the size increase shouldn't be a problem as nightly is developer version.

@jnicol could you share the patch where you enabled MOZ_LOG on geckoview example? it will helpful to try to enable it and see the impact on Fenix.

Thanks in advance!

Flags: needinfo?(jnicol)

It's already enabled on nightly, but not release or beta. Here's the patch to enable it unconditionally: https://hg.mozilla.org/try/rev/2d0f44419cbc9558a64bd1e499e8dd2052297245

Flags: needinfo?(jnicol)
Severity: -- → N/A
Whiteboard: [fxdroid]

Has there been any decision on this, or is there anything blocking making a decision?

(In reply to Jamie Nicol [:jnicol] from comment #3)

Has there been any decision on this, or is there anything blocking making a decision?

Actually, APK size of Fenix sometimes reaches 100MB limit. So I think that we cannot make decision this until we move to AAB (Bug 1809938). AAB size limit is 150MB.

See Also: → 1892943
Component: Core → General

This was previously disabled on release and beta builds in order to
reduce the binary size, but the inability to retrieve logs from users
is a hindrance to fixing bugs. Since we are now shipping AABs can
afford the increase in size.

Assignee: nobody → jnicol
Status: NEW → ASSIGNED

Since we are now shipping AABs our binary size limit has increased, and I hear bug 1899972 may be about to significantly reduce the size. Also, bug 1894703 has made it a lot easier for users to enable the logs (on beta at least, where about:config is enabled). And Paul is planning an overhaul of about:logging soon to make it even slicker. So I think now is the time we should enable logging.

Try pushes for up to date binary size numbers:

Pushed by jnicol@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5a3c143a2682 Enable MOZ_LOG logging on Android. r=android-reviewers,geckoview-reviewers,owlish
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: