make the microsummary service not dump anything to the console unless specifically directed to do so by the browser.microsummary.log preference. Patch by Adam Guthrie (ispiked). bug=343080; r=myk; sr=mconnor

This commit is contained in:
myk@mozilla.org
2007-01-14 05:38:05 +00:00
parent 99b2187eba
commit 22e6ac8800

View File

@@ -1432,11 +1432,28 @@ ArrayEnumerator.prototype = {
function LOG(str) {
dump(str + "\n");
//var css = Cc['@mozilla.org/consoleservice;1'].
// getService(Ci.nsIConsoleService);
//css.logStringMessage("MsS: " + str)
/**
* Outputs aText to the JavaScript console as well as to stdout if the
* microsummary logging pref (browser.microsummary.log) is set to true.
*
* @param aText
* the text to log
*/
function LOG(aText) {
var shouldLog = false;
try {
var pb = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);
shouldLog = pb.getBoolPref("browser.microsummary.log");
}
catch (ex) {}
if (shouldLog) {
dump("*** Microsummaries: " + aText + "\n");
var consoleService = Cc["@mozilla.org/consoleservice;1"].
getService(Ci.nsIConsoleService);
consoleService.logStringMessage(aText);
}
}