Bug 653770 - intermittent oranges from unreported message summary load completion (likely fallout from realistic click generation from bug 640877). have mozmill tests crank up gloda testing without any I/O for fancy pants logging v1. rs=bienvenu
authorAndrew Sutherland <asutherland@asutherland.org>
Mon, 02 May 2011 16:08:15 -0700
changeset 7671 e3f5ac337ac5e3995da2c55c1f8905862c8ff920
parent 7670 9f665a5ea3c6540167e1624fb1dbe5840bd75807
child 7672 fa5918e6aff3ae03cee795c9466436a7e8ac7099
push idunknown
push userunknown
push dateunknown
reviewersbienvenu
bugs653770, 640877
Bug 653770 - intermittent oranges from unreported message summary load completion (likely fallout from realistic click generation from bug 640877). have mozmill tests crank up gloda testing without any I/O for fancy pants logging v1. rs=bienvenu
mail/test/mozmill/runtest.py
mailnews/db/gloda/modules/gloda.js
--- a/mail/test/mozmill/runtest.py
+++ b/mail/test/mozmill/runtest.py
@@ -142,16 +142,19 @@ class ThunderTestProfile(mozrunner.Thund
         # from any random network failures.
         'offline.autoDetect': False,
         # Don't load what's new or the remote start page - keep everything local
         # under our control.
         'mailnews.start_page_override.mstone' :  "ignore",
         'mailnews.start_page.url': "about:blank",
         # Do not enable gloda
         'mailnews.database.global.indexer.enabled': False,
+        # But do have gloda log if it does anything.  (When disabled, queries
+        # are still serviced; they just should not result in any matches.)
+        'mailnews.database.global.logging.upstream': True,
         # Do not allow fonts to be upgraded
         'mail.font.windows.version': 2
         }
 
     # Dummied up local accounts to stop the account wizard
     account_preferences = {
         'mail.account.account1.server' :  "server1",
         'mail.account.account2.identities' :  "id1,id2",
--- a/mailnews/db/gloda/modules/gloda.js
+++ b/mailnews/db/gloda/modules/gloda.js
@@ -181,44 +181,51 @@ var Gloda = {
    *  (via dump) gets everything.
    */
   _initLogging: function gloda_ns_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 prefService = Cc["@mozilla.org/preferences-service;1"].
                           getService(Ci.nsIPrefService);
       let branch = prefService.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 = Cc["@mozilla.org/file/directory_service;1"]
                     .getService(Ci.nsIProperties)
                     .get("TmpD", Ci.nsIFile);
       file.append("chainsaw.ptr");
       if (file.exists()) {
         let data = IOUtils.loadFileToString(file);
         data = data.trim();