Bug 191478 - Web Inspector: Include target identifier in protocol logging
Summary: Web Inspector: Include target identifier in protocol logging
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-11-09 11:36 PST by Joseph Pecoraro
Modified: 2018-11-14 14:00 PST (History)
4 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (8.15 KB, patch)
2018-11-09 11:43 PST, Joseph Pecoraro
hi: review-
Details | Formatted Diff | Diff
[IMAGE] Colored (not what the patch has) (1.11 MB, image/png)
2018-11-09 11:43 PST, Joseph Pecoraro
no flags Details
[IMAGE] After Patch (1.09 MB, image/png)
2018-11-09 11:43 PST, Joseph Pecoraro
no flags Details
[PATCH] Proposed Fix (11.14 KB, patch)
2018-11-09 12:16 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff
[PATCH] Proposed Fix (11.17 KB, patch)
2018-11-09 12:19 PST, Joseph Pecoraro
hi: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2018-11-09 11:36:25 PST
Include styled target identifier in protocol logging

With multi-target support, the number of messages doubles as everything gets routed again through a Target agent message. I'll have a few tweaks to the logging tracer to make it behave as expected again but this is a reasonable change to make regardless. It includes the target identifier in the tracing, so its much easier to follow (and filter).
Comment 1 Joseph Pecoraro 2018-11-09 11:43:26 PST
Created attachment 354363 [details]
[PATCH] Proposed Fix
Comment 2 Joseph Pecoraro 2018-11-09 11:43:43 PST
Created attachment 354364 [details]
[IMAGE] Colored (not what the patch has)
Comment 3 Joseph Pecoraro 2018-11-09 11:43:54 PST
Created attachment 354365 [details]
[IMAGE] After Patch
Comment 4 Devin Rousso 2018-11-09 11:54:59 PST
Comment on attachment 354363 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=354363&action=review

r-, as discussed offline, you didn't include any of the changes to the call-sites of these functions

> Source/WebInspectorUI/ChangeLog:13
> +        (WI.LoggingProtocolTracer.prototype.set filterMultiplexingBackend):
> +        (WI.LoggingProtocolTracer.prototype.get filterMultiplexingBackend):

These aren't part of this patch.

> Source/WebInspectorUI/UserInterface/Protocol/LoggingProtocolTracer.js:112
> +            let connection = entry.connection;

NIT: how about destructuring these variables inside the parameters list?

> Source/WebInspectorUI/UserInterface/Protocol/LoggingProtocolTracer.js:114
> +            this._logToConsole(`${entry.type} (${targetId}): ${JSON.stringify(entry.message)}`);

How about adding colorization when we are showing all targets?  We'd do the default behavior of no color when only showing a single connection.
Comment 5 Joseph Pecoraro 2018-11-09 11:56:33 PST
> > Source/WebInspectorUI/UserInterface/Protocol/LoggingProtocolTracer.js:114
> > +            this._logToConsole(`${entry.type} (${targetId}): ${JSON.stringify(entry.message)}`);
> 
> How about adding colorization when we are showing all targets?  We'd do the
> default behavior of no color when only showing a single connection.

Yeah that is when it becomes more useful. I'll look into it then.
Comment 6 Joseph Pecoraro 2018-11-09 12:16:53 PST
Created attachment 354368 [details]
[PATCH] Proposed Fix
Comment 7 Joseph Pecoraro 2018-11-09 12:17:24 PST
Removing the word "styled" from the title, since I dropped that for now.
Comment 8 Joseph Pecoraro 2018-11-09 12:19:13 PST
Created attachment 354370 [details]
[PATCH] Proposed Fix
Comment 9 Devin Rousso 2018-11-14 11:52:47 PST
Comment on attachment 354370 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=354370&action=review

> Source/WebInspectorUI/UserInterface/Debug/CapturingProtocolTracer.js:42
> +    logFrontendException(connection, message, exception)

Do we not want to save the connection with this as well?
Comment 10 Joseph Pecoraro 2018-11-14 12:45:24 PST
Comment on attachment 354370 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=354370&action=review

>> Source/WebInspectorUI/UserInterface/Debug/CapturingProtocolTracer.js:42
>> +    logFrontendException(connection, message, exception)
> 
> Do we not want to save the connection with this as well?

The `logWillHandleEvent` that happened before this will have had it.
Comment 11 Devin Rousso 2018-11-14 13:33:44 PST
Comment on attachment 354370 [details]
[PATCH] Proposed Fix

r=me
Comment 12 Joseph Pecoraro 2018-11-14 13:59:39 PST
https://trac.webkit.org/r238197
Comment 13 Radar WebKit Bug Importer 2018-11-14 14:00:56 PST
<rdar://problem/46074459>