Bug 244407

Summary: We should use Options::useOSLog to trigger initializeDatafileToUseOSLog
Product: WebKit Reporter: Yijia Huang <yijia_huang>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Yijia Huang
Reported 2022-08-26 12:47:43 PDT
The current implementation to initializeDatafileToUseOSLog is based on useOSLogOptionHasChanged, which is inconvenient for some cases due to useOSLogOptionHasChanged can only be updated in std::optional<OptionsStorage::OSLogType> parse(const char* string) with condition `result && result.value() != Options::useOSLog()`. ``` if (useOSLogOptionHasChanged) { initializeDatafileToUseOSLog(); useOSLogOptionHasChanged = false; } ``` ``` if (result && result.value() != Options::useOSLog()) { useOSLogOptionHasChanged = true; } ``` That means we only can trigger initializeDatafileToUseOSLog() by passing an environment variable other than useOSLog::None. So, the following cases would fail to trigger the initialization function: case 1: change OSLogType::None to OSLogType::Error in OptionsList.h and pass an environment variable `useOSLog=1` case 2: only change OSLogType::None to OSLogType::Error in OptionsList.h We can resolve this by using this ``` if (Options::useOSLog() != OSLogType::None) initializeDatafileToUseOSLog(); ```
Attachments
Radar WebKit Bug Importer
Comment 1 2022-09-02 12:48:19 PDT
Note You need to log in before you can comment on or make changes to this bug.