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 2006-07-18 18:47:25 +00:00
Родитель c6bbb1af05
Коммит ed8219cede
1 изменённых файлов: 22 добавлений и 5 удалений

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

@ -1432,11 +1432,28 @@ ArrayEnumerator.prototype = {
function LOG(str) { /**
dump(str + "\n"); * Outputs aText to the JavaScript console as well as to stdout if the
//var css = Cc['@mozilla.org/consoleservice;1']. * microsummary logging pref (browser.microsummary.log) is set to true.
// getService(Ci.nsIConsoleService); *
//css.logStringMessage("MsS: " + str) * @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);
}
} }