Bug 234525 - Make it possible to enable log channels in WebKitTestRunner and DumpRenderTree
Summary: Make it possible to enable log channels in WebKitTestRunner and DumpRenderTree
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-12-20 13:31 PST by Simon Fraser (smfr)
Modified: 2021-12-20 17:32 PST (History)
4 users (show)

See Also:


Attachments
Patch (10.95 KB, patch)
2021-12-20 13:34 PST, Simon Fraser (smfr)
wenson_hsieh: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (10.95 KB, patch)
2021-12-20 13:53 PST, Simon Fraser (smfr)
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (12.91 KB, patch)
2021-12-20 14:31 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2021-12-20 13:31:47 PST
Make it possible to enable log channels in WebKitTestRunner and DumpRenderTree
Comment 1 Simon Fraser (smfr) 2021-12-20 13:34:10 PST
Created attachment 447629 [details]
Patch
Comment 2 Wenson Hsieh 2021-12-20 13:42:21 PST
Comment on attachment 447629 [details]
Patch

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

> Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm:124
> +        [[NSUserDefaults standardUserDefaults] setValue:[NSString stringWithUTF8String:options.webCoreLogChannels.c_str()] forKey:@"WebKitLogging"];

This should be `options.webKitLogChannels.c_str()`.
Comment 3 Simon Fraser (smfr) 2021-12-20 13:53:25 PST
Created attachment 447634 [details]
Patch
Comment 4 Simon Fraser (smfr) 2021-12-20 14:31:27 PST
Created attachment 447639 [details]
Patch
Comment 5 Sam Weinig 2021-12-20 15:02:11 PST
Comment on attachment 447629 [details]
Patch

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

> Tools/DumpRenderTree/mac/DumpRenderTree.mm:1008
> +        {"WebCoreLogging", required_argument, nullptr, 'W'},

The other options use dashes between words. For consistency, how about -webcore-logging?

> Tools/WebKitTestRunner/Options.cpp:155
> +static bool handleOptionLogChannels(Options& options, const char* option, const char* channels)

Can you move this above the `handleOptionUnmatched` function? I think It makes sense to keep that one last.

> Tools/WebKitTestRunner/Options.cpp:194
> +    optionList.append(Option("--WebCoreLogging", "Enable WebCore log channels", handleOptionLogChannels, true));
> +    optionList.append(Option("--WebKitLogging", "Enable WebKit log channels", handleOptionLogChannels, true));

Same comment as about. Can we keep these consistent as well? Also, I would recommend just using two different functions rather than reparsing.
Comment 6 Simon Fraser (smfr) 2021-12-20 17:31:46 PST
https://trac.webkit.org/changeset/287292/webkit
Comment 7 Radar WebKit Bug Importer 2021-12-20 17:32:17 PST
<rdar://problem/86747488>