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
parent df44475475
commit feb028aa17
2 changed files with 8 additions and 10 deletions

View File

@ -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,

View File

@ -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":