2008-05-30 16:32:06 -07:00
|
|
|
const Cu = Components.utils;
|
|
|
|
Cu.import("resource://weave/log4moz.js");
|
|
|
|
|
2008-05-28 11:25:28 -07:00
|
|
|
const EXPORTED_SYMBOLS = ["FaultTolerance"];
|
|
|
|
|
|
|
|
FaultTolerance = {
|
|
|
|
get Service() {
|
|
|
|
if (!this._Service)
|
|
|
|
this._Service = new FaultToleranceService();
|
|
|
|
return this._Service;
|
|
|
|
}
|
2008-05-30 16:32:06 -07:00
|
|
|
};
|
2008-05-28 11:25:28 -07:00
|
|
|
|
|
|
|
function FaultToleranceService() {
|
|
|
|
}
|
|
|
|
|
|
|
|
FaultToleranceService.prototype = {
|
2008-05-30 16:32:06 -07:00
|
|
|
init: function FTS_init() {
|
|
|
|
var appender = new Appender();
|
|
|
|
|
|
|
|
Log4Moz.Service.rootLogger.addAppender(appender);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
function Formatter() {
|
|
|
|
}
|
|
|
|
Formatter.prototype = {
|
|
|
|
format: function FTF_format(message) {
|
|
|
|
return message;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
Formatter.prototype.__proto__ = new Log4Moz.Formatter();
|
|
|
|
|
|
|
|
function Appender() {
|
|
|
|
this._name = "FaultToleranceAppender";
|
|
|
|
this._formatter = new Formatter();
|
|
|
|
}
|
|
|
|
Appender.prototype = {
|
|
|
|
doAppend: function FTA_append(message) {
|
|
|
|
// TODO: Implement this.
|
2008-05-28 11:25:28 -07:00
|
|
|
}
|
|
|
|
};
|
2008-05-30 16:32:06 -07:00
|
|
|
Appender.prototype.__proto__ = new Log4Moz.Appender();
|