This patch adopts Logger#managerLevelFromPref from Log.jsm to set
and keep track of the Marionette logger's verbosity.
This has the advantage that we do not have to roll separate
implementations of Log for the child- and parent processes. It also
has the upside that the log level will be reflected when changed
at runtime through the use of an observer.
This patch generalises logger setup and access by providing
one interface with specialised implementations for the main-
and child processes. This will mean we can get rid of ad-hoc
logger setup in testing/marionette/components/marionette.js and
testing/marionette/listener.js.
In the case for the component file, the log level and the stdout
dump appender is set up when you request the logger. The same is
true when requesting the logger in a child process, but it will
additionally request the log level from the main process.
Usage:
const {Log} = ChromeUtils.import("chrome://marionette/content/log.js", {});
let log = Log.get();
MozReview-Commit-ID: 8Ha5FSaoGXp
--HG--
extra : rebase_source : 0ad13e805cd1c6a4a8332fdbe6124a82719c4656