Bug 1497259 - 3. Control GV logging through pref; r=droeh, a=ritu GECKOVIEW_62_RELBRANCH
authorJim Chen <nchen@mozilla.com>
Wed, 10 Oct 2018 17:36:13 +0000
branchGECKOVIEW_62_RELBRANCH
changeset 481206 d66bd740b59f
parent 481205 b24c34189591
push id1814
push usernchen@mozilla.com
push dateThu, 11 Oct 2018 21:42:25 +0000
treeherdermozilla-release@d66bd740b59f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdroeh, ritu
bugs1497259
milestone62.0.3
Bug 1497259 - 3. Control GV logging through pref; r=droeh, a=ritu Use the "geckoview.logging" pref to control GV logging. Differential Revision: https://phabricator.services.mozilla.com/D8052
mobile/android/app/geckoview-prefs.js
mobile/android/modules/geckoview/GeckoViewUtils.jsm
--- a/mobile/android/app/geckoview-prefs.js
+++ b/mobile/android/app/geckoview-prefs.js
@@ -11,11 +11,17 @@ pref("dom.ipc.processCount", 1);
 pref("dom.ipc.keepProcessesAlive.web", 1);
 pref("dom.ipc.processPrelaunch.enabled", false);
 
 // Tell Telemetry that we're in GeckoView mode.
 pref("toolkit.telemetry.isGeckoViewMode", true);
 // Disable the Telemetry Event Ping
 pref("toolkit.telemetry.eventping.enabled", false);
 
+#ifdef RELEASE_OR_BETA
+pref("geckoview.logging", "Warn");
+#else
+pref("geckoview.logging", "Debug");
+#endif
+
 // Disable Web Push until we get it working
 pref("dom.push.enabled", false);
 
--- a/mobile/android/modules/geckoview/GeckoViewUtils.jsm
+++ b/mobile/android/modules/geckoview/GeckoViewUtils.jsm
@@ -354,16 +354,17 @@ var GeckoViewUtils = {
     }
     return aScope;
   },
 
   get rootLogger() {
     if (!this._rootLogger) {
       this._rootLogger = Log.repository.getLogger("GeckoView");
       this._rootLogger.addAppender(new Log.AndroidAppender());
+      this._rootLogger.manageLevelFromPref("geckoview.logging");
     }
     return this._rootLogger;
   },
 
   _log: function(aLogger, aLevel, aStrings, aExprs) {
     if (!Array.isArray(aStrings)) {
       const [, file, line] =
           (new Error()).stack.match(/.*\n.*\n.*@(.*):(\d+):/);