I\'m trying to log function arguments into os_log
like this:
func foo(x: String, y: [String:String]) {
//...
os_log(\"foo: \\(x) \\(y.de
The macOS 11 Big Sur Release Notes state that os_log
can now be passed Swift string interpolation:
https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11-beta-release-notes
Logging
New Features
New APIs are available for using
os_log
from Swift as part of the os framework:
A new type Logger can be instantiated using a subsystem and category and provides methods for logging at different levels
( debug(_:) , error(_:) , fault(_:) )
.The Logger APIs support specifying most formatting and privacy options supported by legacy
os_log
APIs.The new APIs provide significant performance improvements over the legacy APIs.
You can now pass Swift string interpolation to the
os_log
function.Note: The new APIs can't be back deployed; however, the existing
os_log
API remains available for back deployment. (22539144)