Skip to content

Commit

Permalink
Bug 1279145 - log manager now cleans old Sync and ReadingList log fil…
Browse files Browse the repository at this point in the history
…es. r=tcsc

MozReview-Commit-ID: JpispWkvlFZ
  • Loading branch information
mhammond committed Jul 18, 2016
1 parent b4e521b commit c2bad4b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions services/common/logmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,13 @@ FlushableStorageAppender.prototype = {

// The public LogManager object.
function LogManager(prefRoot, logNames, logFilePrefix) {
this._prefObservers = [];
this.init(prefRoot, logNames, logFilePrefix);
}

LogManager.prototype = {
_cleaningUpFileLogs: false,

_prefObservers: [],

init(prefRoot, logNames, logFilePrefix) {
if (prefRoot instanceof Preferences) {
this._prefs = prefRoot;
Expand Down Expand Up @@ -301,8 +300,11 @@ LogManager.prototype = {

this._log.debug("Log cleanup threshold time: " + threshold);
yield iterator.forEach(Task.async(function* (entry) {
if (!entry.name.startsWith("error-" + this.logFilePrefix + "-") &&
!entry.name.startsWith("success-" + this.logFilePrefix + "-")) {
// Note that we don't check this.logFilePrefix is in the name - we cleanup
// all files in this directory regardless of that prefix so old logfiles
// for prefixes no longer in use are still cleaned up. See bug 1279145.
if (!entry.name.startsWith("error-") &&
!entry.name.startsWith("success-")) {
return;
}
try {
Expand Down

0 comments on commit c2bad4b

Please sign in to comment.