[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [torbutton/master] Bug 26100: Don't use console object for logging



commit 482abfb95de85bce98043338d8f7fcad9f6b7845
Author: Arthur Edelstein <arthuredelstein@xxxxxxxxx>
Date:   Thu May 17 23:05:44 2018 -0700

    Bug 26100: Don't use console object for logging
---
 src/modules/tor-control-port.js | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/modules/tor-control-port.js b/src/modules/tor-control-port.js
index 2b75e22..2c39936 100644
--- a/src/modules/tor-control-port.js
+++ b/src/modules/tor-control-port.js
@@ -26,14 +26,9 @@ Cu.import("resource://gre/modules/Services.jsm");
 
 // __log__.
 // Logging function
-let log;
-if ((typeof console) !== "undefined") {
-  log = x => console.log(typeof(x) === "string" ? x.trimRight().replace(/\r\n/g, "\n") : JSON.stringify(x));
-} else {
-  let logger = Cc["@torproject.org/torbutton-logger;1"]
-                 .getService(Components.interfaces.nsISupports).wrappedJSObject;
-  log = x => logger.eclog(3, x.trimRight().replace(/\r\n/g, "\n"));
-}
+let logger = Cc["@torproject.org/torbutton-logger;1"]
+               .getService(Components.interfaces.nsISupports).wrappedJSObject;
+let log = x => logger.eclog(3, x.trimRight().replace(/\r\n/g, "\n"));
 
 // ### announce this file
 log("Loading tor-control-port.js\n");

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits