Expose os_log API to include symbol names and source line numbers

Originator:torarnv
Number:rdar://35958308 Date Originated:11.12.2017
Status:Open Resolved:NO
Product:macOS + SDK Product Version:10.13
Classification:Feature Reproducible:
 
os_log captures the image, function, filename, and linenumber automatically, but may not always be correct, e.g. in the case of logging from a wrapper function such as _swift_os_log:

https://github.com/apple/swift/blob/65b0219/stdlib/public/SDK/os/os_log.m#L306

It would be helpful if you could either expose an os_log variant that takes this info as freeform input, or one that takes the address of the relevant function, similar to the trick used by _swift_os_log, without having to expose os_log_pack_send and friends too:

https://github.com/apple/swift/blob/65b0219/stdlib/public/SDK/os/os_log.m#L324

Comments

It appears os_log_with_args would be the perfect candidate for this. Please please please make this function non-SPI :)


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!