[os overlay] Please provide os_log variant that takes `[CVarArg]`
| Originator: | zach | ||
| Number: | rdar://33203955 | Date Originated: | July 9 2017, 4:18 PM |
| Status: | Open | Resolved: | false |
| Product: | Developer Tools | Product Version: | Xcode Version 9.0 beta 2 (9M137d) |
| Classification: | Enhancement | Reproducible: | N/A |
Summary: The Core Team has lamented before that no public API should be provided that only takes Swift varargs (i.e., the `Foo…` pattern) because it prevents API composition. The os_log overlay for Swift does only this. See also: https://github.com/apple/swift/blob/master/stdlib/public/SDK/os/os_log.swift#L23 Steps to Reproduce: Attempt to use os_log in API composition. Expected Results: I can chain transformed argument lists into the overlay's os_log function. Observed Results: I cannot. Version: Xcode Version 9.0 beta 2 (9M137d) Notes: See also: https://github.com/apple/swift/blob/master/stdlib/public/SDK/os/os_log.swift#L23 The extra function would have an identical implementation, just a different prototype. Heck, I might just PR it and reference this radar. Allowing this kind of composition can allow developers to: - Implement more Swifty providers of subsystem/categories. - Provide custom transformations for log values without the extra expense of transforming when a log level is disabled. - Not have to perform this same shimming using C hacks that might break depending on the OS version. Configuration: N/A
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!