Web Inspector: Protocol Logging: log messages with backtrace if inspector^2 is open
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2019 19:28:26 +0000 (19:28 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2019 19:28:26 +0000 (19:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195687

Reviewed by Joseph Pecoraro.

* UserInterface/Protocol/LoggingProtocolTracer.js:
(WI.LoggingProtocolTracer.prototype._processEntry):

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Protocol/LoggingProtocolTracer.js

index aa682cd..401148e 100644 (file)
@@ -1,5 +1,15 @@
 2019-03-13  Devin Rousso  <drousso@apple.com>
 
+        Web Inspector: Protocol Logging: log messages with backtrace if inspector^2 is open
+        https://bugs.webkit.org/show_bug.cgi?id=195687
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Protocol/LoggingProtocolTracer.js:
+        (WI.LoggingProtocolTracer.prototype._processEntry):
+
+2019-03-13  Devin Rousso  <drousso@apple.com>
+
         Web Inspector: REGRESSION(r242737): unnecessary semicolon added when populating WI.TreeOutline stylesheet
         https://bugs.webkit.org/show_bug.cgi?id=195689
 
index 5009a30..e84ca4c 100644 (file)
@@ -121,9 +121,12 @@ WI.LoggingProtocolTracer = class LoggingProtocolTracer extends WI.ProtocolTracer
                 return;
 
             let prefix = `${entry.type} (${targetId})`;
-            if (!window.InspectorTest && InspectorFrontendHost.isBeingInspected())
-                this._logToConsole(prefix, entry.message);
-            else
+            if (!window.InspectorTest && InspectorFrontendHost.isBeingInspected()) {
+                if (entry.type === "request" || entry.type === "exception")
+                    console.trace(prefix, entry.message);
+                else
+                    this._logToConsole(prefix, entry.message);
+            } else
                 this._logToConsole(`${prefix}: ${JSON.stringify(entry.message)}`);
 
             if (entry.exception) {