Bug 944367 - Remove Log4Moz usages from gloda. r=mkmelin
Differential Revision: https://phabricator.services.mozilla.com/D100084 --HG-- extra : amend_source : f01774a6393e640987193fc1041ab87f432fbcb0
This commit is contained in:
Родитель
1f1e17965e
Коммит
3ea6002e97
|
@ -46,9 +46,9 @@ function OAuth2(
|
|||
this.extraAuthParams = [];
|
||||
|
||||
this.log = console.createInstance({
|
||||
prefix: "TBOAuth",
|
||||
prefix: "mailnews.oauth",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "TBOAuth.loglevel",
|
||||
maxLogLevelPref: "mailnews.oauth.loglevel",
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -522,9 +522,6 @@ function GlodaAutoComplete() {
|
|||
TagNoun = loadNS.TagNoun;
|
||||
loadNS = ChromeUtils.import("resource:///modules/gloda/NounFreetag.jsm");
|
||||
FreeTagNoun = loadNS.FreeTagNoun;
|
||||
|
||||
loadNS = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
loadNS.Log4Moz.repository.getLogger("gloda.autocomp");
|
||||
}
|
||||
|
||||
this.completers = [];
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
|
||||
const EXPORTED_SYMBOLS = ["GlodaCollection", "GlodaCollectionManager"];
|
||||
|
||||
const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
|
||||
var LOG = Log4Moz.repository.getLogger("gloda.collection");
|
||||
var LOG = console.createInstance({
|
||||
prefix: "gloda.collection",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
});
|
||||
|
||||
/**
|
||||
* @namespace Central registry and logic for all collections.
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
const EXPORTED_SYMBOLS = ["Gloda"];
|
||||
|
||||
const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
|
||||
const { GlodaDatastore } = ChromeUtils.import(
|
||||
"resource:///modules/gloda/GlodaDatastore.jsm"
|
||||
);
|
||||
|
@ -35,8 +33,6 @@ const { GlodaUtils } = ChromeUtils.import(
|
|||
const { fixIterator } = ChromeUtils.import(
|
||||
"resource:///modules/iteratorUtils.jsm"
|
||||
);
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
|
||||
const { MailServices } = ChromeUtils.import(
|
||||
"resource:///modules/MailServices.jsm"
|
||||
);
|
||||
|
@ -165,62 +161,11 @@ var Gloda = {
|
|||
* (via dump) gets everything.
|
||||
*/
|
||||
_initLogging() {
|
||||
let formatter = new Log4Moz.BasicFormatter();
|
||||
Log4Moz.repository.rootLogger.level = Log4Moz.Level.Debug;
|
||||
|
||||
let enableConsoleLogging = false;
|
||||
let enableDumpLogging = false;
|
||||
// should we assume there is someone else consuming our log4moz stream?
|
||||
let enableUpstreamLogging = false;
|
||||
let considerNetLogging = false;
|
||||
|
||||
let glodaLog = Log4Moz.repository.getLogger("gloda");
|
||||
glodaLog.level = Log4Moz.Level.Warn;
|
||||
|
||||
try {
|
||||
// figure out if event-driven indexing should be enabled...
|
||||
let branch = Services.prefs.getBranch(
|
||||
"mailnews.database.global.logging."
|
||||
);
|
||||
enableConsoleLogging = branch.getBoolPref("console");
|
||||
enableDumpLogging = branch.getBoolPref("dump");
|
||||
enableUpstreamLogging = branch.getBoolPref("upstream");
|
||||
considerNetLogging = branch.getBoolPref("net");
|
||||
} catch (ex) {}
|
||||
|
||||
if (enableConsoleLogging) {
|
||||
let capp = new Log4Moz.ConsoleAppender(formatter);
|
||||
capp.level = Log4Moz.Level.Warn;
|
||||
glodaLog.addAppender(capp);
|
||||
}
|
||||
|
||||
if (enableDumpLogging) {
|
||||
let dapp = new Log4Moz.DumpAppender(formatter);
|
||||
dapp.level = Log4Moz.Level.All;
|
||||
glodaLog.level = Log4Moz.Level.All;
|
||||
glodaLog.addAppender(dapp);
|
||||
}
|
||||
|
||||
if (enableUpstreamLogging) {
|
||||
glodaLog.level = Log4Moz.Level.All;
|
||||
}
|
||||
|
||||
if (considerNetLogging) {
|
||||
let file = Services.dirsvc.get("TmpD", Ci.nsIFile);
|
||||
file.append("chainsaw.ptr");
|
||||
if (file.exists()) {
|
||||
let data = IOUtils.loadFileToString(file);
|
||||
data = data.trim();
|
||||
let [host, port] = data.split(":");
|
||||
let xf = new Log4Moz.XMLFormatter();
|
||||
let sapp = new Log4Moz.SocketAppender(host, Number(port), xf);
|
||||
sapp.level = Log4Moz.Level.All;
|
||||
glodaLog.level = Log4Moz.Level.All;
|
||||
glodaLog.addAppender(sapp);
|
||||
}
|
||||
}
|
||||
|
||||
this._log = Log4Moz.repository.getLogger("gloda.NS");
|
||||
this._log = console.createInstance({
|
||||
prefix: "gloda",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
});
|
||||
this._log.info("Logging Initialized");
|
||||
},
|
||||
|
||||
|
|
|
@ -17,8 +17,11 @@ const { MailServices } = ChromeUtils.import(
|
|||
"resource:///modules/MailServices.jsm"
|
||||
);
|
||||
const { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
|
||||
const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
var LOG = Log4Moz.repository.getLogger("gloda.datamodel");
|
||||
var LOG = console.createInstance({
|
||||
prefix: "gloda.datamodel",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
});
|
||||
|
||||
// Make it lazy.
|
||||
var gMessenger;
|
||||
|
|
|
@ -4,14 +4,16 @@
|
|||
|
||||
const EXPORTED_SYMBOLS = ["GlodaDatabind"];
|
||||
|
||||
const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
|
||||
function GlodaDatabind(aNounDef, aDatastore) {
|
||||
this._nounDef = aNounDef;
|
||||
this._tableName = aNounDef.tableName;
|
||||
this._tableDef = aNounDef.schema;
|
||||
this._datastore = aDatastore;
|
||||
this._log = Log4Moz.repository.getLogger("gloda.databind." + this._tableName);
|
||||
this._log = console.createInstance({
|
||||
prefix: `gloda.databind.${this._tableName}`,
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
});
|
||||
|
||||
// process the column definitions and make sure they have an attribute mapping
|
||||
for (let [iColDef, coldef] of this._tableDef.columns.entries()) {
|
||||
|
|
|
@ -12,8 +12,6 @@ const EXPORTED_SYMBOLS = ["GlodaDatastore"];
|
|||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
|
||||
|
||||
const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
|
||||
const {
|
||||
GlodaAttributeDBDef,
|
||||
GlodaConversation,
|
||||
|
@ -33,7 +31,11 @@ var MIN_CACHE_SIZE = 8 * 1048576;
|
|||
var MAX_CACHE_SIZE = 64 * 1048576;
|
||||
var MEMSIZE_FALLBACK_BYTES = 256 * 1048576;
|
||||
|
||||
var PCH_LOG = Log4Moz.repository.getLogger("gloda.ds.pch");
|
||||
var PCH_LOG = console.createInstance({
|
||||
prefix: "gloda.ds.pch",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
});
|
||||
|
||||
/**
|
||||
* Commit async handler; hands off the notification to
|
||||
|
@ -81,7 +83,11 @@ PostCommitHandler.prototype = {
|
|||
},
|
||||
};
|
||||
|
||||
var QFQ_LOG = Log4Moz.repository.getLogger("gloda.ds.qfq");
|
||||
var QFQ_LOG = console.createInstance({
|
||||
prefix: "gloda.ds.qfq",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
});
|
||||
|
||||
/**
|
||||
* Singleton collection listener used by |QueryFromQueryCallback| to assist in
|
||||
|
@ -1066,7 +1072,11 @@ var GlodaDatastore = {
|
|||
* mapping.
|
||||
*/
|
||||
_init(aNounIDToDef) {
|
||||
this._log = Log4Moz.repository.getLogger("gloda.datastore");
|
||||
this._log = console.createInstance({
|
||||
prefix: "gloda.datastore",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
});
|
||||
this._log.debug("Beginning datastore initialization.");
|
||||
|
||||
this._nounIDToDef = aNounIDToDef;
|
||||
|
@ -3970,9 +3980,6 @@ var GlodaDatastore = {
|
|||
let deps = aItem._deps || {};
|
||||
let hasDeps = false;
|
||||
|
||||
// this._log.debug(" hadDeps: " + hadDeps + " deps: " +
|
||||
// Log4Moz.enumerateProperties(deps).join(","));
|
||||
|
||||
for (let attrib of aItem.NOUN_DEF.specialLoadAttribs) {
|
||||
let objectNounDef = attrib.objectNounDef;
|
||||
|
||||
|
@ -4151,9 +4158,6 @@ var GlodaDatastore = {
|
|||
return;
|
||||
}
|
||||
|
||||
// this._log.debug(" loading deferred, deps: " +
|
||||
// Log4Moz.enumerateProperties(aItem._deps).join(","));
|
||||
|
||||
let attribIDToDBDefAndParam = this._attributeIDToDBDefAndParam;
|
||||
|
||||
for (let [attribId, jsonValue] of Object.entries(aItem._deps)) {
|
||||
|
@ -4175,8 +4179,6 @@ var GlodaDatastore = {
|
|||
references[aItem[attrib.idStorageAttributeName]];
|
||||
}
|
||||
} else if (objectNounDef.tableName) {
|
||||
// this._log.info("trying to load: " + objectNounDef.id + " refs: " +
|
||||
// jsonValue + ": " + Log4Moz.enumerateProperties(jsonValue).join(","));
|
||||
if (attrib.singular) {
|
||||
aItem[attrib.boundName] = references[jsonValue];
|
||||
} else {
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
const EXPORTED_SYMBOLS = ["GlodaExplicitAttr"];
|
||||
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
const { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
|
||||
const { TagNoun } = ChromeUtils.import("resource:///modules/gloda/NounTag.jsm");
|
||||
const { MailServices } = ChromeUtils.import(
|
||||
|
@ -33,7 +32,11 @@ var GlodaExplicitAttr = {
|
|||
_msgTagService: null,
|
||||
|
||||
init() {
|
||||
this._log = Log4Moz.repository.getLogger("gloda.explattr");
|
||||
this._log = console.createInstance({
|
||||
prefix: "gloda.explattr",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
});
|
||||
|
||||
this._msgTagService = MailServices.tags;
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ const { MailServices } = ChromeUtils.import(
|
|||
"resource:///modules/MailServices.jsm"
|
||||
);
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
const { GlodaUtils } = ChromeUtils.import(
|
||||
"resource:///modules/gloda/GlodaUtils.jsm"
|
||||
);
|
||||
|
@ -38,7 +37,11 @@ var GlodaFundAttr = {
|
|||
_log: null,
|
||||
|
||||
init() {
|
||||
this._log = Log4Moz.repository.getLogger("gloda.fundattr");
|
||||
this._log = console.createInstance({
|
||||
prefix: "gloda.fundattr",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
});
|
||||
|
||||
try {
|
||||
this.defineAttributes();
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
const EXPORTED_SYMBOLS = ["GlodaIndexer", "IndexingJob"];
|
||||
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
const { GlodaDatastore } = ChromeUtils.import(
|
||||
"resource:///modules/gloda/GlodaDatastore.jsm"
|
||||
);
|
||||
|
@ -128,7 +127,11 @@ var GlodaIndexer = {
|
|||
* GlodaDatastore.
|
||||
*/
|
||||
_datastore: GlodaDatastore,
|
||||
_log: Log4Moz.repository.getLogger("gloda.indexer"),
|
||||
_log: console.createInstance({
|
||||
prefix: "gloda.indexer",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
}),
|
||||
/**
|
||||
* Our nsITimer that we use to schedule ourselves on the main thread
|
||||
* intermittently. The timer always exists but may not always be active.
|
||||
|
|
|
@ -11,7 +11,6 @@ const { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
|
|||
const { GlodaIndexer, IndexingJob } = ChromeUtils.import(
|
||||
"resource:///modules/gloda/GlodaIndexer.jsm"
|
||||
);
|
||||
const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
const { FreeTagNoun } = ChromeUtils.import(
|
||||
"resource:///modules/gloda/NounFreetag.jsm"
|
||||
);
|
||||
|
@ -28,7 +27,11 @@ var GlodaABIndexer = {
|
|||
name: "index_ab",
|
||||
enable() {
|
||||
if (this._log == null) {
|
||||
this._log = Log4Moz.repository.getLogger("gloda.index_ab");
|
||||
this._log = console.createInstance({
|
||||
prefix: "gloda.index_ab",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
});
|
||||
}
|
||||
|
||||
for (let topic of this._notifications) {
|
||||
|
@ -139,7 +142,11 @@ var GlodaABAttrs = {
|
|||
_log: null,
|
||||
|
||||
init() {
|
||||
this._log = Log4Moz.repository.getLogger("gloda.abattrs");
|
||||
this._log = console.createInstance({
|
||||
prefix: "gloda.abattrs",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
});
|
||||
|
||||
try {
|
||||
this.defineAttributes();
|
||||
|
|
|
@ -22,8 +22,6 @@ const { MailServices } = ChromeUtils.import(
|
|||
);
|
||||
const { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
|
||||
|
||||
const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
|
||||
const { GlodaDatastore } = ChromeUtils.import(
|
||||
"resource:///modules/gloda/GlodaDatastore.jsm"
|
||||
);
|
||||
|
@ -343,7 +341,11 @@ function MessagesByMessageIdCallback(
|
|||
}
|
||||
|
||||
MessagesByMessageIdCallback.prototype = {
|
||||
_log: Log4Moz.repository.getLogger("gloda.index_msg.mbm"),
|
||||
_log: console.createInstance({
|
||||
prefix: "gloda.index_msg.mbm",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
}),
|
||||
|
||||
onItemsAdded(aItems, aCollection) {
|
||||
// just outright bail if we are shutdown
|
||||
|
@ -364,9 +366,7 @@ MessagesByMessageIdCallback.prototype = {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this._log.level <= Log4Moz.Level.Debug) {
|
||||
this._log.debug("query completed, notifying... " + this.results);
|
||||
}
|
||||
this._log.debug("query completed, notifying... " + this.results);
|
||||
|
||||
this.callback.call(this.callbackThis, this.results);
|
||||
},
|
||||
|
@ -441,7 +441,11 @@ var GlodaMsgIndexer = {
|
|||
* GlodaDatastore.
|
||||
*/
|
||||
_datastore: GlodaDatastore,
|
||||
_log: Log4Moz.repository.getLogger("gloda.index_msg"),
|
||||
_log: console.createInstance({
|
||||
prefix: "gloda.index_msg",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
}),
|
||||
|
||||
_junkService: MailServices.junk,
|
||||
|
||||
|
@ -1385,7 +1389,6 @@ var GlodaMsgIndexer = {
|
|||
* Index the contents of a folder.
|
||||
*/
|
||||
*_worker_folderIndex(aJob, aCallbackHandle) {
|
||||
let logDebug = this._log.level <= Log4Moz.Level.Debug;
|
||||
yield this._indexerEnterFolder(aJob.id);
|
||||
|
||||
if (!this.shouldIndexFolder(this._indexingFolder)) {
|
||||
|
@ -1511,17 +1514,13 @@ var GlodaMsgIndexer = {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (logDebug) {
|
||||
this._log.debug(">>> calling _indexMessage");
|
||||
}
|
||||
this._log.debug(">>> calling _indexMessage");
|
||||
yield aCallbackHandle.pushAndGo(
|
||||
this._indexMessage(msgHdr, aCallbackHandle),
|
||||
{ what: "indexMessage", msgHdr }
|
||||
);
|
||||
GlodaIndexer._indexedMessageCount++;
|
||||
if (logDebug) {
|
||||
this._log.debug("<<< back from _indexMessage");
|
||||
}
|
||||
this._log.debug("<<< back from _indexMessage");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3102,12 +3101,9 @@ var GlodaMsgIndexer = {
|
|||
* @pre aMsgHdr.folder.msgDatabase == this._indexingDatabase
|
||||
*/
|
||||
*_indexMessage(aMsgHdr, aCallbackHandle) {
|
||||
let logDebug = this._log.level <= Log4Moz.Level.Debug;
|
||||
if (logDebug) {
|
||||
this._log.debug(
|
||||
"*** Indexing message: " + aMsgHdr.messageKey + " : " + aMsgHdr.subject
|
||||
);
|
||||
}
|
||||
this._log.debug(
|
||||
"*** Indexing message: " + aMsgHdr.messageKey + " : " + aMsgHdr.subject
|
||||
);
|
||||
|
||||
// If the message is offline, then get the message body as well
|
||||
let aMimeMsg;
|
||||
|
@ -3123,13 +3119,11 @@ var GlodaMsgIndexer = {
|
|||
{ saneBodySize: true }
|
||||
);
|
||||
aMimeMsg = (yield this.kWorkAsync)[1];
|
||||
} else if (logDebug) {
|
||||
} else {
|
||||
this._log.debug(" * Message is not offline -- only headers indexed");
|
||||
}
|
||||
|
||||
if (logDebug) {
|
||||
this._log.debug(" * Got message, subject " + aMsgHdr.subject);
|
||||
}
|
||||
this._log.debug(" * Got message, subject " + aMsgHdr.subject);
|
||||
|
||||
if (this._unitTestSuperVerbose) {
|
||||
if (aMimeMsg) {
|
||||
|
@ -3159,18 +3153,12 @@ var GlodaMsgIndexer = {
|
|||
// (ancestorLists has a direct correspondence to the message ids)
|
||||
let ancestorLists = yield this.kWorkAsync;
|
||||
|
||||
if (logDebug) {
|
||||
this._log.debug("ancestors raw: " + ancestorLists);
|
||||
this._log.debug(
|
||||
"ref len: " + references.length + " anc len: " + ancestorLists.length
|
||||
);
|
||||
this._log.debug(
|
||||
"references: " + Log4Moz.enumerateProperties(references).join(",")
|
||||
);
|
||||
this._log.debug(
|
||||
"ancestors: " + Log4Moz.enumerateProperties(ancestorLists).join(",")
|
||||
);
|
||||
}
|
||||
this._log.debug("ancestors raw: " + ancestorLists);
|
||||
this._log.debug(
|
||||
"ref len: " + references.length + " anc len: " + ancestorLists.length
|
||||
);
|
||||
this._log.debug("references: " + references);
|
||||
this._log.debug("ancestors: " + ancestorLists);
|
||||
|
||||
// pull our current message lookup results off
|
||||
references.pop();
|
||||
|
@ -3233,15 +3221,13 @@ var GlodaMsgIndexer = {
|
|||
let ancestorList = ancestorLists[iAncestor];
|
||||
|
||||
if (ancestorList.length == 0) {
|
||||
if (logDebug) {
|
||||
this._log.debug(
|
||||
"creating message with: null, " +
|
||||
conversationID +
|
||||
", " +
|
||||
references[iAncestor] +
|
||||
", null."
|
||||
);
|
||||
}
|
||||
this._log.debug(
|
||||
"creating message with: null, " +
|
||||
conversationID +
|
||||
", " +
|
||||
references[iAncestor] +
|
||||
", null."
|
||||
);
|
||||
let ancestor = this._datastore.createMessage(
|
||||
null,
|
||||
null, // ghost
|
||||
|
@ -3261,20 +3247,16 @@ var GlodaMsgIndexer = {
|
|||
// find if there's a ghost version of our message or we already have indexed
|
||||
// this message.
|
||||
let curMsg = null;
|
||||
if (logDebug) {
|
||||
this._log.debug(candidateCurMsgs.length + " candidate messages");
|
||||
}
|
||||
this._log.debug(candidateCurMsgs.length + " candidate messages");
|
||||
for (let iCurCand = 0; iCurCand < candidateCurMsgs.length; iCurCand++) {
|
||||
let candMsg = candidateCurMsgs[iCurCand];
|
||||
|
||||
if (logDebug) {
|
||||
this._log.debug(
|
||||
"candidate folderID: " +
|
||||
candMsg.folderID +
|
||||
" messageKey: " +
|
||||
candMsg.messageKey
|
||||
);
|
||||
}
|
||||
this._log.debug(
|
||||
"candidate folderID: " +
|
||||
candMsg.folderID +
|
||||
" messageKey: " +
|
||||
candMsg.messageKey
|
||||
);
|
||||
|
||||
if (candMsg.folderURI == this._indexingFolder.URI) {
|
||||
// if we are in the same folder and we have the same message key, we
|
||||
|
@ -3411,10 +3393,7 @@ var GlodaMsgIndexer = {
|
|||
* @TODO: implement deletion of attributes that reference (deleted) messages
|
||||
*/
|
||||
*_deleteMessage(aMessage, aCallbackHandle) {
|
||||
let logDebug = this._log.level <= Log4Moz.Level.Debug;
|
||||
if (logDebug) {
|
||||
this._log.debug("*** Deleting message: " + aMessage);
|
||||
}
|
||||
this._log.debug("*** Deleting message: " + aMessage);
|
||||
|
||||
// -- delete our attributes
|
||||
// delete the message's attributes (if we implement the cascade delete, that
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
const EXPORTED_SYMBOLS = ["FreeTag", "FreeTagNoun"];
|
||||
|
||||
const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
|
||||
const { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
|
||||
|
||||
function FreeTag(aTagName) {
|
||||
|
@ -23,7 +21,11 @@ FreeTag.prototype = {
|
|||
* parameter, we are an odd case and semantically confused.
|
||||
*/
|
||||
var FreeTagNoun = {
|
||||
_log: Log4Moz.repository.getLogger("gloda.noun.freetag"),
|
||||
_log: console.createInstance({
|
||||
prefix: "gloda.noun.freetag",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
}),
|
||||
|
||||
name: "freetag",
|
||||
clazz: FreeTag,
|
||||
|
|
|
@ -5,11 +5,14 @@
|
|||
const EXPORTED_SYMBOLS = ["MimeType", "MimeTypeNoun"];
|
||||
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
var LOG = Log4Moz.repository.getLogger("gloda.noun.mimetype");
|
||||
|
||||
const { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
|
||||
|
||||
var LOG = console.createInstance({
|
||||
prefix: "gloda.noun.mimetype",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
});
|
||||
|
||||
var CategoryStringMap = {};
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,7 +7,11 @@
|
|||
/* import-globals-from ../test_query_core.js */
|
||||
|
||||
var GenericIndexer = {
|
||||
_log: Log4Moz.repository.getLogger("gloda.indexer.generic"),
|
||||
_log: console.createInstance({
|
||||
prefix: "gloda.indexer.generic",
|
||||
maxLogLevel: "Warn",
|
||||
maxLogLevelPref: "gloda.loglevel",
|
||||
}),
|
||||
/* public interface */
|
||||
name: "generic_indexer",
|
||||
enable() {
|
||||
|
|
|
@ -120,13 +120,10 @@ var { MsgHdrToMimeMessage } = ChromeUtils.import(
|
|||
"resource:///modules/gloda/MimeMessage.jsm"
|
||||
);
|
||||
|
||||
// -- Add a logger listener that throws when we give it a warning/error.
|
||||
var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
var throwingAppender = new Log4Moz.ThrowingAppender(do_throw);
|
||||
throwingAppender.level = Log4Moz.Level.Warn;
|
||||
Log4Moz.repository.rootLogger.addAppender(throwingAppender);
|
||||
|
||||
var LOG = Log4Moz.repository.getLogger("gloda.test");
|
||||
var LOG = console.createInstance({
|
||||
prefix: "gloda.test",
|
||||
maxLogLevel: "Warn",
|
||||
});
|
||||
|
||||
/* exported GLODA_BAD_MESSAGE_ID, GLODA_OLD_BAD_MESSAGE_ID */
|
||||
// index_msg does not export this, so we need to provide it.
|
||||
|
|
|
@ -36,41 +36,6 @@ var kDatastoreIDPref = "mailnews.database.global.datastore.id";
|
|||
var kOriginalDatastoreID = "47e4bad6-fedc-4931-bf3f-d2f4146ac63e";
|
||||
Services.prefs.setCharPref(kDatastoreIDPref, kOriginalDatastoreID);
|
||||
|
||||
// -- Add a logger listener that throws when we give it a warning/error.
|
||||
var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
|
||||
|
||||
/**
|
||||
* Count the type of each severity level observed.
|
||||
*/
|
||||
function CountingAppender() {
|
||||
this._name = "CountingAppender";
|
||||
this.counts = {};
|
||||
}
|
||||
CountingAppender.prototype = {
|
||||
reset: function CountingAppender_reset() {
|
||||
this.counts = {};
|
||||
},
|
||||
append: function CountingAppender_append(message) {
|
||||
if (!(message.level in this.counts)) {
|
||||
this.counts[message.level] = 1;
|
||||
} else {
|
||||
this.counts[message.level]++;
|
||||
}
|
||||
},
|
||||
getCountForLevel: function CountingAppender_getCountForLevel(level) {
|
||||
if (level in this.counts) {
|
||||
return this.counts[level];
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
toString() {
|
||||
return "One, two, three! Ah ah ah!";
|
||||
},
|
||||
};
|
||||
|
||||
var countingAppender = new CountingAppender();
|
||||
Log4Moz.repository.rootLogger.addAppender(countingAppender);
|
||||
|
||||
/**
|
||||
* Create an illegal=corrupt database and make sure that we log a message and
|
||||
* still end up happy.
|
||||
|
@ -99,9 +64,6 @@ function test_corrupt_databases_get_reported_and_blown_away() {
|
|||
ostream.write(fileContents, fileContents.length);
|
||||
ostream.close();
|
||||
|
||||
// - reset counts in preparation of gloda init
|
||||
countingAppender.reset();
|
||||
|
||||
// - init gloda, get warnings
|
||||
mark_sub_test_start("init gloda");
|
||||
var { Gloda } = ChromeUtils.import(
|
||||
|
@ -109,12 +71,6 @@ function test_corrupt_databases_get_reported_and_blown_away() {
|
|||
);
|
||||
mark_sub_test_start("gloda inited, checking");
|
||||
|
||||
mark_action("actual", "Counting appender counts", [countingAppender.counts]);
|
||||
// we expect 2 warnings
|
||||
Assert.equal(countingAppender.getCountForLevel(Log4Moz.Level.Warn), 2);
|
||||
// and no errors
|
||||
Assert.equal(countingAppender.getCountForLevel(Log4Moz.Level.Error), 0);
|
||||
|
||||
// - make sure the datastore has an actual database
|
||||
let { GlodaDatastore } = ChromeUtils.import(
|
||||
"resource:///modules/gloda/GlodaDatastore.jsm"
|
||||
|
|
|
@ -996,6 +996,7 @@ pref("ldap_2.servers.osx.dirType", 3);
|
|||
pref("mail.notification.sound", "");
|
||||
pref("mail.notification.count.inbox_only", true);
|
||||
#endif
|
||||
pref("mail.notification.loglevel", "Warn");
|
||||
|
||||
// For the Empty Junk/Trash confirmation dialogs.
|
||||
pref("mailnews.emptyJunk.dontAskAgain", false);
|
||||
|
@ -1064,20 +1065,13 @@ pref("mailnews.database.summary.dontPreserveOnCopy",
|
|||
// Allows extensions to control preservation of properties.
|
||||
pref("mailnews.database.summary.dontPreserveOnMove",
|
||||
"account msgOffset threadParent msgThreadId statusOfset flags size numLines ProtoThreadFlags label storeToken");
|
||||
// Should we output dbcache log via dump? Set to "Debug" to show.
|
||||
pref("mailnews.database.dbcache.logging.dump", "None");
|
||||
// Should we output dbcache log to the "error console"? Set to "Debug" to show.
|
||||
pref("mailnews.database.dbcache.logging.console", "None");
|
||||
// Should we output dbcache log? Set to "Debug" to show.
|
||||
pref("mailnews.database.dbcache.loglevel", "Warn");
|
||||
|
||||
// -- Global Database (gloda) options
|
||||
// Should the indexer be enabled?
|
||||
pref("mailnews.database.global.indexer.enabled", false);
|
||||
// Should we output warnings and errors to the "error console"?
|
||||
pref("mailnews.database.global.logging.console", false);
|
||||
// Should we output all output levels to stdout via dump?
|
||||
pref("mailnews.database.global.logging.dump", false);
|
||||
// Should we consider outputting all levels via the network?
|
||||
pref("mailnews.database.global.logging.net", false);
|
||||
pref("gloda.loglevel", "Warn");
|
||||
// Rate of growth of the gloda cache, whose maximum value is 8 MiB and max is 64 MiB.
|
||||
// See more: https://developer.mozilla.org/en/Thunderbird/gloda#Cache_Size"
|
||||
pref("mailnews.database.global.datastore.cache_to_memory_permillage", 10);
|
||||
|
@ -1105,3 +1099,5 @@ pref("mail.imap.qos", 0);
|
|||
pref("mail.pgpmime.addon_url", "https://addons.mozilla.org/addon/enigmail/");
|
||||
|
||||
pref("msgAsyncPrompter.loglevel", "Warn");
|
||||
|
||||
pref("mailnews.oauth.loglevel", "Warn");
|
||||
|
|
Загрузка…
Ссылка в новой задаче