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.
--- 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);
};