diff --git a/mail/components/accountcreation/content/emailWizard.js b/mail/components/accountcreation/content/emailWizard.js index 18c2b51489..1a01b3bbd9 100644 --- a/mail/components/accountcreation/content/emailWizard.js +++ b/mail/components/accountcreation/content/emailWizard.js @@ -24,7 +24,6 @@ var { OAuth2Providers } = ChromeUtils.import( "resource:///modules/OAuth2Providers.jsm" ); -var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm"); var { cleanUpHostName, isLegalHostNameOrIP, @@ -58,14 +57,6 @@ var { // from http://xyfer.blogspot.com/2005/01/javascript-regexp-email-validator.html var emailRE = /^[-_a-z0-9\'+*$^&%=~!?{}]+(?:\.[-_a-z0-9\'+*$^&%=~!?{}]+)*@(?:[-a-z0-9.]+\.[a-z]{2,20}|\d{1,3}(?:\.\d{1,3}){3})(?::\d+)?$/i; -if (typeof gEmailWizardLogger == "undefined") { - var gEmailWizardLogger = Log4Moz.getConfiguredLogger("mail.setup"); - gEmailWizardLogger.level = Log4Moz.Level.Info; - gEmailWizardLogger.addAppender( - new Log4Moz.ConsoleAppender(new Log4Moz.BasicFormatter()) - ); // browser console -} - var gStringsBundle; var gMessengerBundle; var gBrandShortName; diff --git a/mail/components/accountcreation/content/fetchhttp.js b/mail/components/accountcreation/content/fetchhttp.js index 565cf4f984..448b3613a4 100644 --- a/mail/components/accountcreation/content/fetchhttp.js +++ b/mail/components/accountcreation/content/fetchhttp.js @@ -108,7 +108,7 @@ function FetchHTTP(url, args, successCallback, errorCallback) { this._args.timeout = sanitize.integer(args.timeout || 5000); // default 5 seconds this._successCallback = successCallback; this._errorCallback = errorCallback; - this._logger = Log4Moz.getConfiguredLogger("mail.setup"); + this._logger = gEmailWizardLogger; this._logger.info("Requesting <" + url + ">"); } FetchHTTP.prototype = { diff --git a/mail/components/accountcreation/content/guessConfig.js b/mail/components/accountcreation/content/guessConfig.js index 9ef41804fc..de8eea8d80 100644 --- a/mail/components/accountcreation/content/guessConfig.js +++ b/mail/components/accountcreation/content/guessConfig.js @@ -5,7 +5,6 @@ /* import-globals-from emailWizard.js */ -var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm"); var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); // This is a bit ugly - we set outgoingDone to false @@ -168,7 +167,7 @@ function guessConfig( } }; - var logger = Log4Moz.getConfiguredLogger("mail.setup"); + var logger = gEmailWizardLogger; var HostTryToAccountServer = function(thisTry, server) { server.type = protocolToString(thisTry.protocol); server.hostname = thisTry.hostname; @@ -394,7 +393,7 @@ function HostDetector(progressCallback, successCallback, errorCallback) { this._hostsToTry = []; // init logging - this._log = Log4Moz.getConfiguredLogger("mail.wizard"); + this._log = gEmailWizardLogger; this._log.info("created host detector"); } @@ -1004,7 +1003,7 @@ function protocolToString(type) { /** * @param thisTry {HostTry} - * @param logger {Log4Moz logger} + * @param logger {ConsoleAPI} */ function SSLErrorHandler(thisTry, logger) { this._try = thisTry; diff --git a/mail/components/accountcreation/content/util.js b/mail/components/accountcreation/content/util.js index 82c46a1f60..98cb1a15fe 100644 --- a/mail/components/accountcreation/content/util.js +++ b/mail/components/accountcreation/content/util.js @@ -10,6 +10,7 @@ var { logException } = ChromeUtils.import("resource:///modules/ErrUtils.jsm"); var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); +var { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm"); // -------------------------- // Low level, basic functions @@ -668,12 +669,11 @@ function deepCopy(org) { } if (typeof gEmailWizardLogger == "undefined") { - var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm"); - var gEmailWizardLogger = Log4Moz.getConfiguredLogger("mail.setup"); - gEmailWizardLogger.level = Log4Moz.Level.Info; - gEmailWizardLogger.addAppender( - new Log4Moz.ConsoleAppender(new Log4Moz.BasicFormatter()) - ); // browser console + var gEmailWizardLogger = new ConsoleAPI({ + prefix: "mail.setup", + maxLogLevel: "warn", + maxLogLevelPref: "mail.setup.loglevel", + }); } function ddump(text) { diff --git a/mail/components/accountcreation/content/verifyConfig.js b/mail/components/accountcreation/content/verifyConfig.js index 5a71c508eb..8a95ee1fa8 100644 --- a/mail/components/accountcreation/content/verifyConfig.js +++ b/mail/components/accountcreation/content/verifyConfig.js @@ -13,11 +13,6 @@ var { OAuth2Providers } = ChromeUtils.import( ); var { logException } = ChromeUtils.import("resource:///modules/ErrUtils.jsm"); -if (typeof gEmailWizardLogger == "undefined") { - var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm"); - var gEmailWizardLogger = Log4Moz.getConfiguredLogger("mail.wizard"); -} - /** * This checks a given config, by trying a real connection and login, * with username and password. @@ -217,7 +212,7 @@ function urlListener( this.mErrorCallback = errorCallback; this.mMsgWindow = msgWindow; this.mCertError = false; - this._log = Log4Moz.getConfiguredLogger("mail.wizard"); + this._log = gEmailWizardLogger; } urlListener.prototype = { OnStartRunningUrl(aUrl) {