Bug 918408 - remove marionette.log file, enable stdout logging via pref for non-debug/non-b2g builds, r=jgriffin

This commit is contained in:
Malini Das 2013-10-29 13:45:13 -04:00
Родитель df44475475
Коммит feb028aa17
2 изменённых файлов: 8 добавлений и 10 удалений

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

@ -12,6 +12,7 @@ class GeckoInstance(object):
required_prefs = {"marionette.defaultPrefs.enabled": True,
"marionette.defaultPrefs.port": 2828,
"marionette.logging": True,
"startup.homepage_welcome_url": "about:blank",
"browser.shell.checkDefaultBrowser": False,
"browser.startup.page": 0,

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

@ -11,6 +11,7 @@ const MARIONETTE_CONTRACTID = "@mozilla.org/marionette;1";
const MARIONETTE_CID = Components.ID("{786a1369-dca5-4adc-8486-33d23c88010a}");
const MARIONETTE_ENABLED_PREF = 'marionette.defaultPrefs.enabled';
const MARIONETTE_FORCELOCAL_PREF = 'marionette.force-local';
const MARIONETTE_LOG_PREF = 'marionette.logging';
this.ServerSocket = CC("@mozilla.org/network/server-socket;1",
"nsIServerSocket",
@ -31,21 +32,20 @@ function MarionetteComponent() {
// set up the logger
this.logger = Log.repository.getLogger("Marionette");
this.logger.level = Log.Level["Trace"];
let logf = FileUtils.getFile('ProfD', ['marionette.log']);
let dumper = false;
let formatter = new Log.BasicFormatter();
this.logger.addAppender(new Log.BoundedFileAppender(logf.path, formatter));
#ifdef DEBUG
dumper = true;
#endif
#ifdef MOZ_B2G
dumper = true;
#endif
if (dumper) {
this.logger.addAppender(new Log.DumpAppender(formatter));
try {
if (dumper || Services.prefs.getBoolPref(MARIONETTE_LOG_PREF)) {
let formatter = new Log.BasicFormatter();
this.logger.addAppender(new Log.DumpAppender(formatter));
}
}
this.logger.info("MarionetteComponent loaded");
catch(e) {}
}
MarionetteComponent.prototype = {
@ -100,9 +100,6 @@ MarionetteComponent.prototype = {
this.observerService.addObserver(this, "domwindowopened", false);
}
}
else {
this.logger.info("marionette not enabled via pref");
}
#endif
break;
case "final-ui-startup":