Bug 1340491 - ProfileAge shouldn't spam stdout/stderr by default, r?MattN draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 20 Feb 2017 18:07:32 +0000
changeset 487095 301e808d2ed6fdd9e13f9cf9c3ebd0bbd9cc8cae
parent 487087 d0462b0948e0b1147dcce615bddcc46379bdadb2
child 546380 83bd624c994e96bc7db5448a08c991a9cff9e540
push id46130
push usergijskruitbosch@gmail.com
push dateMon, 20 Feb 2017 18:08:11 +0000
reviewersMattN
bugs1340491
milestone54.0a1
Bug 1340491 - ProfileAge shouldn't spam stdout/stderr by default, r?MattN MozReview-Commit-ID: CysAlG1hMXL
toolkit/modules/ProfileAge.jsm
--- a/toolkit/modules/ProfileAge.jsm
+++ b/toolkit/modules/ProfileAge.jsm
@@ -19,17 +19,20 @@ Cu.import("resource://services-common/ut
  * This is separate from the provider to simplify testing and enable extraction
  * to a shared location in the future.
  */
 this.ProfileAge = function(profile, log) {
   this.profilePath = profile || OS.Constants.Path.profileDir;
   if (!this.profilePath) {
     throw new Error("No profile directory.");
   }
-  this._log = log || {"debug": function(s) { dump(s + "\n"); }};
+  if (!log) {
+    log = Log.repository.getLogger("Toolkit.ProfileAge");
+  }
+  this._log = log;
 }
 this.ProfileAge.prototype = {
   /**
    * There are three ways we can get our creation time:
    *
    * 1. From our own saved value (to avoid redundant work).
    * 2. From the on-disk JSON file.
    * 3. By calculating it from the filesystem.