Bug 1340491 - ProfileAge shouldn't spam stdout/stderr by default, r?MattN
MozReview-Commit-ID: CysAlG1hMXL
--- 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.