diff --git a/remote/cdp/Connection.jsm b/remote/cdp/Connection.jsm index b8ba697248447..758dbba2dc2cc 100644 --- a/remote/cdp/Connection.jsm +++ b/remote/cdp/Connection.jsm @@ -16,7 +16,7 @@ XPCOMUtils.defineLazyModuleGetters(this, { UnknownMethodError: "chrome://remote/content/cdp/Error.jsm", }); -XPCOMUtils.defineLazyGetter(this, "log", () => Log.get()); +XPCOMUtils.defineLazyGetter(this, "logger", () => Log.get()); XPCOMUtils.defineLazyServiceGetter( this, @@ -65,7 +65,7 @@ class Connection { send(body) { const payload = JSON.stringify(body, null, Log.verbose ? "\t" : null); - log.trace(truncate`<-(connection ${this.id}) ${payload}`); + logger.trace(truncate`<-(connection ${this.id}) ${payload}`); this.transport.send(JSON.parse(payload)); } @@ -186,7 +186,7 @@ class Connection { * JSON-serializable object sent by the client */ async onPacket(packet) { - log.trace(`(connection ${this.id})-> ${JSON.stringify(packet)}`); + logger.trace(`(connection ${this.id})-> ${JSON.stringify(packet)}`); try { const { id, method, params, sessionId } = packet; diff --git a/remote/cdp/Error.jsm b/remote/cdp/Error.jsm index 0c7b36df274cf..fdb31c45f2282 100644 --- a/remote/cdp/Error.jsm +++ b/remote/cdp/Error.jsm @@ -21,7 +21,7 @@ XPCOMUtils.defineLazyModuleGetters(this, { Log: "chrome://remote/content/shared/Log.jsm", }); -XPCOMUtils.defineLazyGetter(this, "log", () => Log.get()); +XPCOMUtils.defineLazyGetter(this, "logger", () => Log.get()); class RemoteAgentError extends Error { constructor(message = "", cause = undefined) { @@ -37,7 +37,7 @@ class RemoteAgentError extends Error { notify() { Cu.reportError(this); - log.error(this.toString({ stack: true })); + logger.error(this.toString({ stack: true })); } toString({ stack = false } = {}) { @@ -94,7 +94,7 @@ class FatalError extends RemoteAgentError { } notify() { - log.fatal(this.toString({ stack: true })); + logger.fatal(this.toString({ stack: true })); } quit(mode = Ci.nsIAppStartup.eForceQuit) { diff --git a/remote/components/RemoteAgent.jsm b/remote/components/RemoteAgent.jsm index 3d90dbad786f6..c331bcc69b0a1 100644 --- a/remote/components/RemoteAgent.jsm +++ b/remote/components/RemoteAgent.jsm @@ -21,7 +21,7 @@ XPCOMUtils.defineLazyModuleGetters(this, { TargetList: "chrome://remote/content/cdp/targets/TargetList.jsm", }); -XPCOMUtils.defineLazyGetter(this, "log", () => Log.get()); +XPCOMUtils.defineLazyGetter(this, "logger", () => Log.get()); const ENABLED = "remote.enabled"; const FORCE_LOCAL = "remote.force-local"; @@ -82,7 +82,7 @@ class RemoteAgentClass { for (let [k, v] of RecommendedPreferences) { if (!Preferences.isSet(k)) { - log.debug(`Setting recommended pref ${k} to ${v}`); + logger.debug(`Setting recommended pref ${k} to ${v}`); Preferences.set(k, v); this.alteredPrefs.add(k); } @@ -118,14 +118,14 @@ class RemoteAgentClass { ); } catch (e) { await this.close(); - log.error(`Unable to start remote agent: ${e.message}`, e); + logger.error(`Unable to start remote agent: ${e.message}`, e); } } close() { try { for (let k of this.alteredPrefs) { - log.debug(`Resetting recommended pref ${k}`); + logger.debug(`Resetting recommended pref ${k}`); Preferences.reset(k); } this.alteredPrefs.clear(); @@ -141,7 +141,7 @@ class RemoteAgentClass { } } catch (e) { // this function must never fail - log.error("unable to stop listener", e); + logger.error("unable to stop listener", e); } finally { this.server = null; this.targetList = null; diff --git a/remote/shared/Format.jsm b/remote/shared/Format.jsm index 4ece70dad8d68..b6c92e9d88ab6 100644 --- a/remote/shared/Format.jsm +++ b/remote/shared/Format.jsm @@ -16,7 +16,7 @@ XPCOMUtils.defineLazyModuleGetters(this, { Log: "chrome://remote/content/shared/Log.jsm", }); -XPCOMUtils.defineLazyGetter(this, "log", () => Log.get()); +XPCOMUtils.defineLazyGetter(this, "logger", () => Log.get()); const ELEMENT_NODE = 1; const MAX_STRING_LENGTH = 250; @@ -101,7 +101,7 @@ function pprint(ss, ...values) { try { s = pretty(values[i]); } catch (e) { - log.warn("Problem pretty printing:", e); + logger.warn("Problem pretty printing:", e); s = typeof values[i]; } res.push(s);