fix log4moz calls (new api), fix module imports for renamed modules

This commit is contained in:
Dan Mills 2008-11-03 15:00:38 -08:00
parent 11eb07f4eb
commit 6151afb26d
13 changed files with 28 additions and 28 deletions

View File

@ -107,7 +107,7 @@ function AsyncException(asyncStack, exceptionToWrap) {
function Generator(thisArg, method, onComplete, args) {
this._outstandingCbs = 0;
this._log = Log4Moz.Service.getLogger("Async.Generator");
this._log = Log4Moz.repository.getLogger("Async.Generator");
this._log.level =
Log4Moz.Level[Utils.prefs.getCharPref("log.logger.async")];
this._thisArg = thisArg;

View File

@ -45,8 +45,7 @@ const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://weave/log4moz.js");
Cu.import("resource://weave/util.js");
Cu.import("resource://weave/dav.js");
Cu.import("resource://weave/remote.js");
Cu.import("resource://weave/resource.js");
Cu.import("resource://weave/async.js");
Function.prototype.async = Async.sugar;
@ -94,7 +93,7 @@ ClientDataSvc.prototype = {
},
_init: function ClientData__init() {
this._log = Log4Moz.Service.getLogger("Service.ClientData");
this._log = Log4Moz.repository.getLogger("Service.ClientData");
this._remote = new Resource("meta/clients");
this._remote.pushFilter(new JsonFilter());
},

View File

@ -84,7 +84,7 @@ CryptoSvc.prototype = {
},
_init: function Crypto__init() {
this._log = Log4Moz.Service.getLogger("Service." + this._logName);
this._log = Log4Moz.repository.getLogger("Service." + this._logName);
this._log.level =
Log4Moz.Level[Utils.prefs.getCharPref("log.logger.service.crypto")];
let branch = Cc["@mozilla.org/preferences-service;1"]

View File

@ -48,8 +48,7 @@ Cu.import("resource://weave/constants.js");
Cu.import("resource://weave/util.js");
Cu.import("resource://weave/wrap.js");
Cu.import("resource://weave/crypto.js");
Cu.import("resource://weave/dav.js");
Cu.import("resource://weave/remote.js");
Cu.import("resource://weave/resource.js");
Cu.import("resource://weave/clientData.js");
Cu.import("resource://weave/identity.js");
Cu.import("resource://weave/stores.js");
@ -173,7 +172,7 @@ Engine.prototype = {
try { level = Utils.prefs.getCharPref(levelPref); }
catch (e) { /* ignore unset prefs */ }
this._log = Log4Moz.Service.getLogger("Service." + this.logName);
this._log = Log4Moz.repository.getLogger("Service." + this.logName);
this._log.level = Log4Moz.Level[level];
this._osPrefix = "weave:" + this.name + ":";
},
@ -504,8 +503,9 @@ BlobEngine.prototype = {
this._log.info("Beginning sync");
this._os.notifyObservers(null, "weave:service:sync:engine:start", this.name);
if (!(yield DAV.MKCOL(this.serverPrefix, self.cb)))
throw "Could not create remote folder";
// FIXME
//if (!(yield DAV.MKCOL(this.serverPrefix, self.cb)))
// throw "Could not create remote folder";
try {
if ("none" != Utils.prefs.getCharPref("encryption"))

View File

@ -55,7 +55,6 @@ const INCOMING_SHARE_ROOT_NAME = "Shared Folders";
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://weave/log4moz.js");
Cu.import("resource://weave/dav.js");
Cu.import("resource://weave/util.js");
Cu.import("resource://weave/crypto.js");
Cu.import("resource://weave/async.js");
@ -67,7 +66,7 @@ Cu.import("resource://weave/identity.js");
Cu.import("resource://weave/xmpp/xmppClient.js");
Cu.import("resource://weave/notifications.js");
Cu.import("resource://weave/sharing.js");
Cu.import("resource://weave/remote.js");
Cu.import("resource://weave/resource.js");
Function.prototype.async = Async.sugar;
@ -100,7 +99,7 @@ BookmarksSharingManager.prototype = {
_init: function SharingManager__init(engine) {
this._engine = engine;
this._log = Log4Moz.Service.getLogger("Bookmark Share");
this._log = Log4Moz.repository.getLogger("Bookmark Share");
if ( Utils.prefs.getBoolPref( "xmpp.enabled" ) ) {
this._log.info( "Starting XMPP client for bookmark engine..." );
this._startXmppClient.async(this);
@ -301,8 +300,8 @@ BookmarksSharingManager.prototype = {
},
_getNewShares: function BmkSharing__getNewShares() {
let self = yield;
let sharingApi = new Sharing.Api( DAV );
// FIXME
// let sharingApi = new Sharing.Api( DAV );
let result = yield sharingApi.getShares(self.cb);
this._log.info("Got Shares: " + result);
@ -440,7 +439,8 @@ BookmarksSharingManager.prototype = {
/* Create the directory on the server if it does not exist already. */
let serverPath = "share/" + folderGuid;
let ret = yield DAV.MKCOL(serverPath, self.cb);
// FIXME
// let ret = yield DAV.MKCOL(serverPath, self.cb);
if (!ret) {
this._log.error("Can't create remote folder for outgoing share.");
@ -463,7 +463,8 @@ BookmarksSharingManager.prototype = {
}
// Call Atul's js api for setting htaccess:
let sharingApi = new Sharing.Api( DAV );
// FIXME
// let sharingApi = new Sharing.Api( DAV );
let result = yield sharingApi.shareWithUsers( serverPath,
[username], folderName,
self.cb );
@ -1414,7 +1415,7 @@ BookmarksTracker.prototype = {
},
_init: function BMT__init() {
this._log = Log4Moz.Service.getLogger("Service." + this._logName);
this._log = Log4Moz.repository.getLogger("Service." + this._logName);
this._score = 0;
Cc["@mozilla.org/browser/nav-bookmarks-service;1"].

View File

@ -50,9 +50,9 @@ FaultTolerance = {
};
function FTService() {
this._log = Log4Moz.Service.getLogger("FaultTolerance");
this._log = Log4Moz.repository.getLogger("FaultTolerance");
this._appender = new FTAppender(this);
Log4Moz.Service.rootLogger.addAppender(this._appender);
Log4Moz.repository.rootLogger.addAppender(this._appender);
}
FTService.prototype = {
get lastException() this._lastException,

View File

@ -129,7 +129,7 @@ function NotificationButton(label, accessKey, callback) {
try {
callback.apply(this, arguments);
} catch (e) {
let logger = Log4Moz.Service.getLogger("Notifications");
let logger = Log4Moz.repository.getLogger("Notifications");
logger.error("An exception occurred: " + Utils.exceptionStr(e));
logger.info(Utils.stackTrace(e));
throw e;

View File

@ -71,7 +71,7 @@ OAuthSvc.prototype = {
_cb2: null,
_init: function OAuth__init() {
this._log = Log4Moz.Service.getLogger("Service." + this._logName);
this._log = Log4Moz.repository.getLogger("Service." + this._logName);
this._log.level = "Debug";
this._log.info("OAuth Module Initialized");
},

View File

@ -82,7 +82,7 @@ Store.prototype = {
},
_init: function Store__init() {
this._log = Log4Moz.Service.getLogger("Service." + this._logName);
this._log = Log4Moz.repository.getLogger("Service." + this._logName);
},
applyCommands: function Store_applyCommands(commandList) {
@ -180,7 +180,7 @@ SnapshotStore.prototype = {
_init: function SStore__init(name) {
this.filename = name;
this._log = Log4Moz.Service.getLogger("Service." + this._logName);
this._log = Log4Moz.repository.getLogger("Service." + this._logName);
},
_createCommand: function SStore__createCommand(command) {

View File

@ -67,7 +67,7 @@ SyncCore.prototype = {
_store: null,
_init: function SC__init() {
this._log = Log4Moz.Service.getLogger("Service." + this._logName);
this._log = Log4Moz.repository.getLogger("Service." + this._logName);
},
// FIXME: this won't work for deep objects, or objects with optional

View File

@ -71,7 +71,7 @@ Tracker.prototype = {
_score: 0,
_init: function T__init() {
this._log = Log4Moz.Service.getLogger("Service." + this._logName);
this._log = Log4Moz.repository.getLogger("Service." + this._logName);
this._score = 0;
},

View File

@ -198,7 +198,7 @@ function HTTPPollingTransport( serverUrl, useKeys, interval ) {
}
HTTPPollingTransport.prototype = {
_init: function( serverUrl, useKeys, interval ) {
this._log = Log4Moz.Service.getLogger("Service.XmppTransportLayer");
this._log = Log4Moz.repository.getLogger("Service.XmppTransportLayer");
this._log.info("Initializing transport: serverUrl=" + serverUrl + ", useKeys=" + useKeys + ", interval=" + interval);
this._serverUrl = serverUrl
this._n = 0;

View File

@ -71,7 +71,7 @@ XmppClient.prototype = {
IQ_ERROR: -1,
_init: function( clientName, realm, clientPassword, transport, authenticator ) {
this._log = Log4Moz.Service.getLogger("Service.XmppClient");
this._log = Log4Moz.repository.getLogger("Service.XmppClient");
this._myName = clientName;
this._realm = realm;
this._fullName = clientName + "@" + realm;