Bug 244407
Summary: | We should use Options::useOSLog to trigger initializeDatafileToUseOSLog | ||
---|---|---|---|
Product: | WebKit | Reporter: | Yijia Huang <yijia_huang> |
Component: | JavaScriptCore | Assignee: | 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
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/99500809>