[Webkit-unassigned] [Bug 244407] New: We should use Options::useOSLog to trigger initializeDatafileToUseOSLog

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 26 12:47:43 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=244407

            Bug ID: 244407
           Summary: We should use Options::useOSLog to trigger
                    initializeDatafileToUseOSLog
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: yijia_huang at apple.com

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();
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220826/e4fa6ed0/attachment.htm>


More information about the webkit-unassigned mailing list