NEW 244407
We should use Options::useOSLog to trigger initializeDatafileToUseOSLog
https://bugs.webkit.org/show_bug.cgi?id=244407
Summary We should use Options::useOSLog to trigger initializeDatafileToUseOSLog
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.