Enable Gecko Log Modules (aka MOZ_LOG) using the preference logging.config.modules

184 views
Skip to first unread message

Julien Wajsberg

unread,
May 27, 2024, 9:21:17 AM5/27/24
to dev-pl...@mozilla.org

Hey folks,

It's been notoriously difficult to get MOZ_LOG output from Firefox for Android (aka Fenix). Setting environment variables is cumbersome, setting individual preferences is painful, about:logging isn't working there either.

That's why I implemented in bug 1894703 (https://bugzilla.mozilla.org/show_bug.cgi?id=1894703) another way to set MOZ_LOG modules using a single preference.

Now it's possible to open about:config, and set just one preference logging.config.modules with the same MOZ_LOG syntax that you know and love. Note that about:config isn't available in Fenix Release.

Then it's possible to use the Firefox Profiler to capture these log messages: more information about that in https://profiler.firefox.com/docs/#/./guide-profiling-firefox-android.


I'd also like to thank Paul Adenot for his support while implementing this.


Happy debugging!

--

Julien

Julien Wajsberg

unread,
May 27, 2024, 9:30:01 AM5/27/24
to dev-pl...@mozilla.org

Small erratum: it's not in the Nightly currently available in Play Store, it should be in the next one.

Valentin Gosu

unread,
May 27, 2024, 9:55:46 AM5/27/24
to Julien Wajsberg, dev-pl...@mozilla.org
Thank you for the great news, Julien!

I haven't actually tried this out on release Fenix, but I believe it should be possible to set the pref there too using the Multiprocess Toolbox in about:debugging and executing `Services.prefs.setCharPref("logging.config.modules", ...)`
Though if I understand correctly, logging is currently disabled on late beta and release? https://bugzilla.mozilla.org/show_bug.cgi?id=1841818

--
You received this message because you are subscribed to the Google Groups "dev-pl...@mozilla.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dev-platform...@mozilla.org.
To view this discussion on the web visit https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/a9a63e41-554f-4364-b44e-491c4d41448f%40mozilla.com.

Julien Wajsberg

unread,
May 27, 2024, 11:12:19 AM5/27/24
to Valentin Gosu, dev-pl...@mozilla.org
Le 27/05/2024 à 15:55, Valentin Gosu a écrit :
> Thank you for the great news, Julien!
>
> I haven't actually tried this out on release Fenix, but I believe it
> should be possible to set the pref there too using the Multiprocess
> Toolbox in about:debugging and executing
> `Services.prefs.setCharPref("logging.config.modules", ...)`
> Though if I understand correctly, logging is currently disabled on
> late beta and release?
> https://bugzilla.mozilla.org/show_bug.cgi?id=1841818


Ah I believe you're right. I wonder if we could accept these extra
~900kB now that getting logs is easier.

Also it would be great to have about:config in Release as well
(https://bugzilla.mozilla.org/show_bug.cgi?id=1813163), but with a
warning screen (https://bugzilla.mozilla.org/show_bug.cgi?id=1647160).
All the arguments against having it on Release apply also on Desktop,
yet we have hundreds of millions of users on Desktop but about:config is
available there.


--
Julien

Reply all
Reply to author
Forward
0 new messages