1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 var EXPORTED_SYMBOLS = ["Log"];
9 const { Log: StdLog } = ChromeUtils.import("resource://gre/modules/Log.jsm");
10 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
12 const LOG_LEVEL = "remote.log.level";
14 /** E10s compatible wrapper for the standard logger from Log.jsm. */
17 const logger = StdLog.repository.getLogger("RemoteAgent");
18 if (logger.ownAppenders.length == 0) {
19 logger.addAppender(new StdLog.DumpAppender());
20 logger.manageLevelFromPref(LOG_LEVEL);
25 static get verbose() {
26 // we can't use Preferences.jsm before first paint,
27 // see ../browser/base/content/test/performance/browser_startup.js
28 const level = Services.prefs.getStringPref(LOG_LEVEL, "Info");
29 return StdLog.Level[level] >= StdLog.Level.Info;