Bug 1497259 - 3. Control GV logging through pref; r=droeh
authorJim Chen <nchen@mozilla.com>
Wed, 10 Oct 2018 17:36:13 +0000
changeset 496329 0df87bbe161e757b7fee9a0213ef07a62bf77ae9
parent 496328 20cd9ac747da9b457d594fb385f13ace7bffbff2
child 496330 6bfe39bf5e4dd380f6caa96e0e65ab9cdb149a71
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdroeh
bugs1497259
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1497259 - 3. Control GV logging through pref; r=droeh 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
@@ -13,11 +13,17 @@ pref("dom.ipc.processPrelaunch.enabled",
 
 // Tell Telemetry that we're in GeckoView mode.
 pref("toolkit.telemetry.isGeckoViewMode", true);
 // Disable the Telemetry Event Ping
 pref("toolkit.telemetry.eventping.enabled", false);
 
 pref("geckoview.console.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
@@ -396,16 +396,17 @@ var GeckoViewUtils = {
     }
     return aScope;
   },
 
   get rootLogger() {
     if (!this._rootLogger) {
       this._rootLogger = Log.repository.getLogger("GeckoView");
       this._rootLogger.addAppender(new 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+):/);