Bug 944367 - Remove Log4Moz from newmailaccount and mailnews/base. r=mkmelin

Differential Revision: https://phabricator.services.mozilla.com/D99755
This commit is contained in:
Ping Chen 2020-12-16 05:03:19 +00:00
Родитель 4f08f7a16c
Коммит fa9d012f66
7 изменённых файлов: 45 добавлений и 31 удалений

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

@ -7,6 +7,7 @@
var { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
var { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm");
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
@ -17,11 +18,14 @@ var { PluralForm } = ChromeUtils.import(
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
// Get a configured logger for this component.
// To debug, set mail.provider.logging.dump (or .console)="All"
var gLog = Log4Moz.getConfiguredLogger("mail.provider");
var gLog = new ConsoleAPI({
prefix: "mail.provider",
maxLogLevel: "warn",
maxLogLevelPref: "mail.provider.loglevel",
});
var stringBundle = Services.strings.createBundle(
"chrome://messenger/locale/newmailaccount/accountProvisioner.properties"
);

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

@ -8,7 +8,7 @@
/* globals specialTabs */
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm");
/**
* A content tab for the account provisioner. We use Javascript-y magic to
@ -27,7 +27,13 @@ var accountProvisionerTabType = Object.create(specialTabs.contentTabType, {
},
},
},
_log: { value: Log4Moz.getConfiguredLogger("mail.provider") },
_log: {
value: new ConsoleAPI({
prefix: "mail.provider",
maxLogLevel: "warn",
maxLogLevelPref: "mail.provider.loglevel",
}),
},
});
/**

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

@ -1,4 +1,4 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -6,15 +6,13 @@
/* platform-independent code to count new and unread messages and pass the information to
* platform-specific notification modules
*
* Logging for this module uses the TB version of log4moz. Default logging is at the Warn
* level. Other possibly interesting messages are at Error, Info and Debug. To configure, set the
* preferences "mail.notification.logging.console" (for the error console) or
* "mail.notification.logging.dump" (for stderr) to the string indicating the level you want.
* Default logging is at the Warn level. Other possibly interesting messages are
* at Error, Info and Debug. To configure, set the preferences
* "mail.notification.loglevel" to the string indicating the level you want.
*/
var EXPORTED_SYMBOLS = ["NewMailNotificationService"];
var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
@ -44,12 +42,11 @@ function NewMailNotificationService() {
this._listeners = [];
this.wrappedJSObject = this;
this._log = Log4Moz.getConfiguredLogger(
"mail.notification",
Log4Moz.Level.Warn,
Log4Moz.Level.Warn,
Log4Moz.Level.Warn
);
this._log = console.createInstance({
prefix: "mail.notification",
maxLogLevel: "Warn",
maxLogLevelPref: "mail.notification.loglevel",
});
// Listen for mail-startup-done to do the rest of our setup after folders are initialized
Services.obs.addObserver(this, "mail-startup-done");

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

@ -8,7 +8,6 @@ var { Deprecated } = ChromeUtils.import(
"resource://gre/modules/Deprecated.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
function runnablePrompter(asyncPrompter, hashKey) {
this._asyncPrompter = asyncPrompter;
@ -80,17 +79,16 @@ runnablePrompter.prototype = {
function MsgAsyncPrompter() {
this._pendingPrompts = {};
// By default, only log warnings to the error console and errors to dump().
// You can use the preferences:
// msgAsyncPrompter.logging.console
// msgAsyncPrompter.logging.dump
// By default, only log warnings to the error console
// You can use the preference:
// msgAsyncPrompter.loglevel
// To change this up. Values should be one of:
// Fatal/Error/Warn/Info/Config/Debug/Trace/All
this._log = Log4Moz.getConfiguredLogger(
"msgAsyncPrompter",
Log4Moz.Level.Warn,
Log4Moz.Level.Warn
);
this._log = console.createInstance({
prefix: "msgAsyncPrompter",
maxLogLevel: "Warn",
maxLogLevelPref: "msgAsyncPrompter.loglevel",
});
}
MsgAsyncPrompter.prototype = {

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

@ -14,8 +14,12 @@ var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var log = Log4Moz.getConfiguredLogger("mailnews.database.dbcache");
var log = console.createInstance({
prefix: "dbcache",
maxLogLevel: "Warn",
maxLogLevelPref: "mailnews.database.dbcache.loglevel",
});
/**
*/

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

@ -9,7 +9,6 @@
var EXPORTED_SYMBOLS = ["OAuth2"];
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
Cu.importGlobalProperties(["fetch"]);
@ -46,7 +45,11 @@ function OAuth2(
this.extraAuthParams = [];
this.log = Log4Moz.getConfiguredLogger("TBOAuth");
this.log = console.createInstance({
prefix: "TBOAuth",
maxLogLevel: "Warn",
maxLogLevelPref: "TBOAuth.loglevel",
});
}
OAuth2.prototype = {

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

@ -757,7 +757,7 @@ pref("rss.show.content-base", 0);
// 1 - load web page in default browser, on select
pref("rss.message.loadWebPageOnSelect", 0);
pref("Feeds.loglevel", "Info");
pref("Feeds.loglevel", "Warn");
// 0=default as attachment
// 1=forward as quoted (mapped to 2 in mozilla)
@ -1107,3 +1107,5 @@ pref("mail.imap.qos", 0);
// PgpMime Addon
pref("mail.pgpmime.addon_url", "https://addons.mozilla.org/addon/enigmail/");
pref("msgAsyncPrompter.loglevel", "Warn");