Web Inspector: Provide an engineering option to log protocol traffic as text
authorpecoraro@apple.com <pecoraro@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Aug 2019 16:42:57 +0000 (16:42 +0000)
committerpecoraro@apple.com <pecoraro@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Aug 2019 16:42:57 +0000 (16:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200969

Reviewed by Devin Rousso.

* UserInterface/Base/Setting.js:
* UserInterface/Protocol/LoggingProtocolTracer.js:
(WI.LoggingProtocolTracer.prototype._processEntry):
(WI.LoggingProtocolTracer):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createDebugSettingsView):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249014 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Setting.js
Source/WebInspectorUI/UserInterface/Protocol/LoggingProtocolTracer.js
Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js

index 1fc88d0..a8736d9 100644 (file)
@@ -1,3 +1,17 @@
+2019-08-22  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Provide an engineering option to log protocol traffic as text
+        https://bugs.webkit.org/show_bug.cgi?id=200969
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Base/Setting.js:
+        * UserInterface/Protocol/LoggingProtocolTracer.js:
+        (WI.LoggingProtocolTracer.prototype._processEntry):
+        (WI.LoggingProtocolTracer):
+        * UserInterface/Views/SettingsTabContentView.js:
+        (WI.SettingsTabContentView.prototype._createDebugSettingsView):
+
 2019-08-21  Nikita Vasilyev  <nvasilyev@apple.com>
 
         Web Inspector: RTL: DOM outline in Elements tab should be LTR
index dc25a5a..9394ae6 100644 (file)
@@ -189,6 +189,7 @@ WI.settings = {
     experimentalEnableStylesJumpToEffective: new WI.Setting("experimental-styles-jump-to-effective", false),
 
     // Protocol
+    protocolLogAsText: new WI.Setting("protocol-log-as-text", false),
     protocolAutoLogMessages: new WI.Setting("protocol-auto-log-messages", false),
     protocolAutoLogTimeStats: new WI.Setting("protocol-auto-log-time-stats", false),
     protocolFilterMultiplexingBackendMessages: new WI.Setting("protocol-filter-multiplexing-backend-messages", true),
index e84ca4c..6010e34 100644 (file)
@@ -121,7 +121,7 @@ WI.LoggingProtocolTracer = class LoggingProtocolTracer extends WI.ProtocolTracer
                 return;
 
             let prefix = `${entry.type} (${targetId})`;
-            if (!window.InspectorTest && InspectorFrontendHost.isBeingInspected()) {
+            if (!window.InspectorTest && InspectorFrontendHost.isBeingInspected() && !WI.settings.protocolLogAsText.value) {
                 if (entry.type === "request" || entry.type === "exception")
                     console.trace(prefix, entry.message);
                 else
index f38d09e..3fb8399 100644 (file)
@@ -413,6 +413,7 @@ WI.SettingsTabContentView = class SettingsTabContentView extends WI.TabContentVi
         });
 
         protocolMessagesGroup.addSetting(WI.settings.protocolAutoLogTimeStats, WI.unlocalizedString("Time Stats"));
+        protocolMessagesGroup.addSetting(WI.settings.protocolLogAsText, WI.unlocalizedString("Log as Text"));
 
         this._debugSettingsView.addSeparator();