mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 599928 - Need a single pref to toggle logging [r=mconnor]
This commit is contained in:
parent
64852ef56f
commit
61d949b838
@ -357,22 +357,26 @@ WeaveSvc.prototype = {
|
||||
dapp.level = Log4Moz.Level[Svc.Prefs.get("log.appender.dump")];
|
||||
root.addAppender(dapp);
|
||||
|
||||
let verbose = Svc.Directory.get("ProfD", Ci.nsIFile);
|
||||
verbose.QueryInterface(Ci.nsILocalFile);
|
||||
verbose.append("weave");
|
||||
verbose.append("logs");
|
||||
verbose.append("verbose-log.txt");
|
||||
if (!verbose.exists())
|
||||
verbose.create(verbose.NORMAL_FILE_TYPE, PERMS_FILE);
|
||||
|
||||
let maxSize = 65536; // 64 * 1024 (64KB)
|
||||
this._debugApp = new Log4Moz.RotatingFileAppender(verbose, formatter, maxSize);
|
||||
this._debugApp.level = Log4Moz.Level[Svc.Prefs.get("log.appender.debugLog")];
|
||||
root.addAppender(this._debugApp);
|
||||
let enabled = Svc.Prefs.get("log.appender.debugLog.enabled", false);
|
||||
if (enabled) {
|
||||
let verbose = Svc.Directory.get("ProfD", Ci.nsIFile);
|
||||
verbose.QueryInterface(Ci.nsILocalFile);
|
||||
verbose.append("weave");
|
||||
verbose.append("logs");
|
||||
verbose.append("verbose-log.txt");
|
||||
if (!verbose.exists())
|
||||
verbose.create(verbose.NORMAL_FILE_TYPE, PERMS_FILE);
|
||||
|
||||
let maxSize = 65536; // 64 * 1024 (64KB)
|
||||
this._debugApp = new Log4Moz.RotatingFileAppender(verbose, formatter, maxSize);
|
||||
this._debugApp.level = Log4Moz.Level[Svc.Prefs.get("log.appender.debugLog")];
|
||||
root.addAppender(this._debugApp);
|
||||
}
|
||||
},
|
||||
|
||||
clearLogs: function WeaveSvc_clearLogs() {
|
||||
this._debugApp.clear();
|
||||
if (this._debugApp)
|
||||
this._debugApp.clear();
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user