move logs and snapshots into a 'weave' directory in the profile; use .txt filenames for logs to (hopefully) fix content type problems some people are seeing

This commit is contained in:
Dan Mills 2007-12-19 19:49:28 -08:00
Родитель 56b54b801e
Коммит b957c13f7d
2 изменённых файлов: 28 добавлений и 12 удалений

Просмотреть файл

@ -244,16 +244,31 @@ WeaveSyncService.prototype = {
root.addAppender(dapp);
let logFile = this._dirSvc.get("ProfD", Ci.nsIFile);
let verboseFile = logFile.clone();
logFile.append("bm-sync.log");
logFile.QueryInterface(Ci.nsILocalFile);
verboseFile.append("bm-sync-verbose.log");
verboseFile.QueryInterface(Ci.nsILocalFile);
let fapp = Log4Moz.Service.newFileAppender("rotating", logFile, formatter);
let brief = this._dirSvc.get("ProfD", Ci.nsIFile);
brief.QueryInterface(Ci.nsILocalFile);
brief.append("weave");
if (!brief.exists())
brief.create(brief.DIRECTORY_TYPE, PERMS_DIRECTORY);
brief.append("logs");
if (!brief.exists())
brief.create(brief.DIRECTORY_TYPE, PERMS_DIRECTORY);
brief.append("brief-log.txt");
if (!brief.exists())
brief.create(brief.NORMAL_FILE_TYPE, PERMS_FILE);
let verbose = brief.parent.clone();
verbose.append("verbose-log.txt");
if (!verbose.exists())
verbose.create(verbose.NORMAL_FILE_TYPE, PERMS_FILE);
let fapp = Log4Moz.Service.newFileAppender("rotating", brief, formatter);
fapp.level = Log4Moz.Level.Info;
root.addAppender(fapp);
let vapp = Log4Moz.Service.newFileAppender("rotating", verboseFile, formatter);
let vapp = Log4Moz.Service.newFileAppender("rotating", verbose, formatter);
vapp.level = Log4Moz.Level.Debug;
root.addAppender(vapp);
},

Просмотреть файл

@ -175,16 +175,17 @@ SnapshotStore.prototype = {
this._log.info("Saving snapshot to disk");
let file = this._dirSvc.get("ProfD", Ci.nsIFile);
file.append("weave-snapshots");
file.QueryInterface(Ci.nsILocalFile);
file.append("weave");
if (!file.exists())
file.create(file.DIRECTORY_TYPE, PERMS_DIRECTORY);
file.append("snapshots");
if (!file.exists())
file.create(file.DIRECTORY_TYPE, PERMS_DIRECTORY);
file.QueryInterface(Ci.nsIFile);
file.append(this.filename);
file.QueryInterface(Ci.nsILocalFile);
if (!file.exists())
file.create(file.NORMAL_FILE_TYPE, PERMS_FILE);