Bug 1231660 - Log raw packet instead of stringified messages in Marionette server; r?AutomatedTester draft
authorAndreas Tolfsen <ato@mozilla.com>
Fri, 08 Jan 2016 16:01:07 +0000
changeset 320095 62ec4c09d6f51e71943bb0e980d8de0fdce06ea6
parent 320094 3f780f4b14acab29b16bc4141a44180a8af9dd08
child 512684 fa1724e3e104b2cc0ed12f8d7c7bec7b5d6d3e59
push id9131
push useratolfsen@mozilla.com
push dateFri, 08 Jan 2016 16:05:11 +0000
reviewersAutomatedTester
bugs1231660
milestone46.0a1
Bug 1231660 - Log raw packet instead of stringified messages in Marionette server; r?AutomatedTester Implementors and users find it better if we log the actual sent and received packets, rather than a stringification of the messages representing them.
testing/marionette/dispatcher.js
--- a/testing/marionette/dispatcher.js
+++ b/testing/marionette/dispatcher.js
@@ -235,10 +235,11 @@ Dispatcher.prototype.sendRaw = function(
   this.conn.send(payload);
 };
 
 Dispatcher.prototype.log_ = function(msg) {
   if (logger.level > Log.Level.Debug) {
     return;
   }
   let a = (msg.origin == MessageOrigin.Client ? " -> " : " <- ");
-  logger.debug(this.connId + a + msg);
+  let s = JSON.stringify(msg.toMsg());
+  logger.trace(this.connId + a + s);
 };