Bug 1172141 - Use the maxLogLevelPref ConsoleAPI option for Loop and UITour to make logging preferences live. r=bgrins
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Mon, 08 Jun 2015 16:18:00 -0700
changeset 247723 84d422afe66ddeb2206a77d0748c17ba50dd77a0
parent 247722 7584dcefd15c703b85d1a09167f4433b72aaa5d0
child 247724 e7875576b0427c666f350ef6d9449dd97b031d36
push id13422
push usermozilla@noorenberghe.ca
push dateTue, 09 Jun 2015 19:11:02 +0000
treeherderfx-team@84d422afe66d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1172141
milestone41.0a1
Bug 1172141 - Use the maxLogLevelPref ConsoleAPI option for Loop and UITour to make logging preferences live. r=bgrins
browser/components/loop/modules/MozLoopService.jsm
browser/components/uitour/UITour.jsm
--- a/browser/components/loop/modules/MozLoopService.jsm
+++ b/browser/components/loop/modules/MozLoopService.jsm
@@ -117,17 +117,17 @@ XPCOMUtils.defineLazyServiceGetter(this,
 XPCOMUtils.defineLazyServiceGetter(this, "gWM",
                                    "@mozilla.org/appshell/window-mediator;1",
                                    "nsIWindowMediator");
 
 // Create a new instance of the ConsoleAPI so we can control the maxLogLevel with a pref.
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   let ConsoleAPI = Cu.import("resource://gre/modules/devtools/Console.jsm", {}).ConsoleAPI;
   let consoleOptions = {
-    maxLogLevel: Services.prefs.getCharPref(PREF_LOG_LEVEL).toLowerCase(),
+    maxLogLevelPref: PREF_LOG_LEVEL,
     prefix: "Loop"
   };
   return new ConsoleAPI(consoleOptions);
 });
 
 function setJSONPref(aName, aValue) {
   let value = !!aValue ? JSON.stringify(aValue) : "";
   Services.prefs.setCharPref(aName, value);
--- a/browser/components/uitour/UITour.jsm
+++ b/browser/components/uitour/UITour.jsm
@@ -65,18 +65,17 @@ const SEENPAGEID_EXPIRY  = 8 * 7 * 24 * 
 
 // Prefix for any target matching a search engine.
 const TARGET_SEARCHENGINE_PREFIX = "searchEngine-";
 
 // Create a new instance of the ConsoleAPI so we can control the maxLogLevel with a pref.
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   let ConsoleAPI = Cu.import("resource://gre/modules/devtools/Console.jsm", {}).ConsoleAPI;
   let consoleOptions = {
-    // toLowerCase is because the loglevel values use title case to be compatible with Log.jsm.
-    maxLogLevel: Services.prefs.getCharPref(PREF_LOG_LEVEL).toLowerCase(),
+    maxLogLevelPref: PREF_LOG_LEVEL,
     prefix: "UITour",
   };
   return new ConsoleAPI(consoleOptions);
 });
 
 this.UITour = {
   url: null,
   seenPageIDs: null,