Bug 1351465 - shield-recipe-client: Unconditionally set up logging in bootstrap r?Gijs draft
authorMike Cooper <mcooper@mozilla.com>
Wed, 29 Mar 2017 13:49:37 -0700
changeset 553340 f02e61bbb2ed1f1f327550061cb593c8da152c7a
parent 553339 bcdbcf403b9c56bb496b08900bd52553f026ad15
child 622034 f720a1c8bd39b8a830afc216576da018fb9a132d
push id51599
push userbmo:mcooper@mozilla.com
push dateWed, 29 Mar 2017 20:50:02 +0000
reviewersGijs
bugs1351465
milestone55.0a1
Bug 1351465 - shield-recipe-client: Unconditionally set up logging in bootstrap r?Gijs MozReview-Commit-ID: 5W7UdpsLyYd
browser/extensions/shield-recipe-client/bootstrap.js
--- a/browser/extensions/shield-recipe-client/bootstrap.js
+++ b/browser/extensions/shield-recipe-client/bootstrap.js
@@ -52,27 +52,27 @@ this.install = function() {
       shouldRun = false;
     }
   }
 };
 
 this.startup = function() {
   setDefaultPrefs();
 
-  if (!shouldRun) {
-    return;
-  }
-
   // Setup logging and listen for changes to logging prefs
   LogManager.configure(Services.prefs.getIntPref(PREF_LOGGING_LEVEL));
   log = LogManager.getLogger("bootstrap");
   Preferences.observe(PREF_LOGGING_LEVEL, LogManager.configure);
   CleanupManager.addCleanupHandler(
     () => Preferences.ignore(PREF_LOGGING_LEVEL, LogManager.configure));
 
+  if (!shouldRun) {
+    return;
+  }
+
   RecipeRunner.init();
 };
 
 this.shutdown = function(data, reason) {
   CleanupManager.cleanup();
 
   if (reason === REASONS.ADDON_DISABLE || reason === REASONS.ADDON_UNINSTALL) {
     Services.prefs.setBoolPref(PREF_SELF_SUPPORT_ENABLED, true);