Bug 175731 - Add WTFLogChannel level to allow runtime log filtering
Summary: Add WTFLogChannel level to allow runtime log filtering
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-18 11:56 PDT by Eric Carlson
Modified: 2017-08-21 06:03 PDT (History)
10 users (show)

See Also:


Attachments
Proposed patch. (24.66 KB, patch)
2017-08-18 12:43 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff
Patch for landing. (25.02 KB, patch)
2017-08-20 12:38 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews124 for ios-simulator-wk2 (1.07 MB, application/zip)
2017-08-20 16:26 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2017-08-18 11:56:22 PDT
Add a "level" field to WTFLogChannel and new log functions and macros so logging can be filtered at runtime.
Comment 1 Radar WebKit Bug Importer 2017-08-18 11:57:08 PDT
<rdar://problem/33967234>
Comment 2 Eric Carlson 2017-08-18 12:43:27 PDT
Created attachment 318529 [details]
Proposed patch.
Comment 3 Build Bot 2017-08-18 12:45:13 PDT
Attachment 318529 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/Assertions.h:176:  LOG_CHANNEL is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WTF/wtf/Assertions.h:179:  LOG_CHANNEL is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WTF/wtf/Assertions.h:452:  Extra space after ( in function call  [whitespace/parens] [4]
Total errors found: 3 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 WebKit Commit Bot 2017-08-18 15:46:21 PDT
Comment on attachment 318529 [details]
Proposed patch.

Clearing flags on attachment: 318529

Committed r220938: <http://trac.webkit.org/changeset/220938>
Comment 5 WebKit Commit Bot 2017-08-18 15:46:22 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Ryan Haddad 2017-08-18 17:18:41 PDT
(In reply to WebKit Commit Bot from comment #4)
> Comment on attachment 318529 [details]
> Proposed patch.
> 
> Clearing flags on attachment: 318529
> 
> Committed r220938: <http://trac.webkit.org/changeset/220938>
API tests added with this change are failing on iOS Simulator:

Tests that failed:
  LoggingTest.LOG
  LoggingTest.LOG_WITH_LEVEL
  LoggingTest.RELEASE_LOG
  LoggingTest.RELEASE_LOG_IF
  LoggingTest.RELEASE_LOG_WITH_LEVEL
  LoggingTest.RELEASE_LOG_WITH_LEVEL_IF

https://build.webkit.org/builders/Apple%20iOS%2010%20Simulator%20Release%20WK2%20(Tests)/builds/3719
Comment 7 Ryan Haddad 2017-08-18 17:23:24 PDT
Actually, they fail on macOS as well:

https://build.webkit.org/builders/Apple%20El%20Capitan%20Release%20WK1%20(Tests)/builds/4068
Comment 8 Ryan Haddad 2017-08-18 17:31:04 PDT
Reverted r220938 for reason:

The API tests added with this change are failing.

Committed r220947: <http://trac.webkit.org/changeset/220947>
Comment 9 Eric Carlson 2017-08-18 21:36:42 PDT
(In reply to Ryan Haddad from comment #8)
> Reverted r220938 for reason:
> 
> The API tests added with this change are failing.
> 
> Committed r220947: <http://trac.webkit.org/changeset/220947>

How is it that the so-called "early warning" bots *still* don't run API tests?
Comment 10 Eric Carlson 2017-08-18 21:41:35 PDT
It looks like using pipe+fcntl+dup2 to capture stderr output doesn't work on all platforms, so maybe I should disable the tests and commit.
Comment 11 Eric Carlson 2017-08-18 21:42:34 PDT
WKWebViewDoesNotLogDuringInitialization.mm uses the same technique to check for logging output, but it only fails if somethings is written to the FD so the test doesn't fail if the technique fails.
Comment 12 Eric Carlson 2017-08-20 12:38:07 PDT
Created attachment 318604 [details]
Patch for landing.
Comment 13 Build Bot 2017-08-20 14:30:49 PDT
Attachment 318604 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/Assertions.h:176:  LOG_CHANNEL is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WTF/wtf/Assertions.h:179:  LOG_CHANNEL is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WTF/wtf/Assertions.h:452:  Extra space after ( in function call  [whitespace/parens] [4]
Total errors found: 3 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 Build Bot 2017-08-20 16:26:37 PDT
Comment on attachment 318604 [details]
Patch for landing.

Attachment 318604 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/4350245

New failing tests:
quicklook/multi-sheet-numbers-09.html
Comment 15 Build Bot 2017-08-20 16:26:38 PDT
Created attachment 318606 [details]
Archive of layout-test-results from ews124 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews124  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.5
Comment 16 WebKit Commit Bot 2017-08-21 06:03:08 PDT
Comment on attachment 318604 [details]
Patch for landing.

Clearing flags on attachment: 318604

Committed r220964: <http://trac.webkit.org/changeset/220964>
Comment 17 WebKit Commit Bot 2017-08-21 06:03:10 PDT
All reviewed patches have been landed.  Closing bug.