fix 'clear logs' on windows

This commit is contained in:
Dan Mills 2008-03-28 19:36:11 -07:00
parent 012d0d35d3
commit 5ec2b83320
2 changed files with 16 additions and 6 deletions

View File

@ -397,6 +397,11 @@ FileAppender.prototype = {
} catch(e) {
dump("Error writing file:\n" + e);
}
},
clear: function FApp_clear() {
this.closeStream();
this._file.remove(false);
}
};
FileAppender.prototype.__proto__ = new Appender();

View File

@ -263,12 +263,17 @@ WeaveSvc.prototype = {
if (!verbose.exists())
verbose.create(verbose.NORMAL_FILE_TYPE, PERMS_FILE);
let fapp = Log4Moz.Service.newFileAppender("rotating", brief, formatter);
fapp.level = Log4Moz.Level[Utils.prefs.getCharPref("log.appender.briefLog")];
root.addAppender(fapp);
let vapp = Log4Moz.Service.newFileAppender("rotating", verbose, formatter);
vapp.level = Log4Moz.Level[Utils.prefs.getCharPref("log.appender.debugLog")];
root.addAppender(vapp);
this._briefApp = Log4Moz.Service.newFileAppender("rotating", brief, formatter);
this._briefApp.level = Log4Moz.Level[Utils.prefs.getCharPref("log.appender.briefLog")];
root.addAppender(this._briefApp);
this._debugApp = Log4Moz.Service.newFileAppender("rotating", verbose, formatter);
this._debugApp.level = Log4Moz.Level[Utils.prefs.getCharPref("log.appender.debugLog")];
root.addAppender(this._debugApp);
},
clearLogs: function WeaveSvc_clearLogs() {
this._briefApp.clear();
this._debugApp.clear();
},
_createUserDir: function WeaveSync__createUserDir(serverURL) {