Bug 241719

Summary: Enhance Options::useOSLog to accept an os log type value.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, ews-watchlist, keith_miller, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
EWS testing.
ews-feeder: commit-queue-
EWS testing.
ews-feeder: commit-queue-
EWS testing. none

Description Mark Lam 2022-06-17 10:56:50 PDT
This option only applies to OS(DARWIN).

For example, we can now use any of these:
    --useOSLog=default    // logs to OS_LOG_TYPE_DEFAULT
    --useOSLog=info       // logs to OS_LOG_TYPE_INFO
    --useOSLog=debug      // logs to OS_LOG_TYPE_DEBUG
    --useOSLog=error      // logs to OS_LOG_TYPE_ERROR
    --useOSLog=fault.     // logs to OS_LOG_TYPE_FAULT

We can still use --useOSLog=0 or false (which means do the normal dataLog) and --useOSLog=1 or true (which means dataLog to OS_LOG_TYPE_ERROR).

Previously, when we specify --useOSLog=1, we will data log to OS_LOG_TYPE_INFO.  This has been a source of friction in usage because no one ever remembers that we need enable OS_LOG_TYPE_INFO in the log stream  to see this logging.  Instead, --useOSLog=1 will now log to OS_LOG_TYPE_ERROR, which ensures that logging will show up in log stream.  This is fine to do because the --useOSLog=1 option indicates that the client really wants to see the logs.  Otherwise, the client can use one of the other os log types if they want something different.

Secondly, because -useOSLog=1 indicates that the client really wants to see the logs, logging to OS_LOG_TYPE_ERROR ensures that the logging is flushed to the file system instead of sitting in a memory buffer, and potentially not showing up in the log stream.
Comment 1 Mark Lam 2022-06-17 11:25:51 PDT
Pull request: https://github.com/WebKit/WebKit/pull/1598
Comment 2 Mark Lam 2022-06-17 14:46:28 PDT
Created attachment 460312 [details]
EWS testing.
Comment 3 Mark Lam 2022-06-17 17:14:34 PDT
Created attachment 460321 [details]
EWS testing.
Comment 4 Mark Lam 2022-06-17 19:21:09 PDT
Created attachment 460324 [details]
EWS testing.
Comment 5 EWS 2022-06-17 21:27:14 PDT
Committed r295656 (251661@main): <https://commits.webkit.org/251661@main>

Reviewed commits have been landed. Closing PR #1598 and removing active labels.
Comment 6 Radar WebKit Bug Importer 2022-06-17 21:28:13 PDT
<rdar://problem/95433917>
Comment 7 Alexey Proskuryakov 2022-06-17 22:21:07 PDT
*** Bug 241721 has been marked as a duplicate of this bug. ***