我正在尝试将函数参数记录到os_log这样:
func foo(x: String, y: [String:String]) {
//...
os_log("foo: \(x) \(y.description)", log: OSLog.default, type: .debug)
}
Run Code Online (Sandbox Code Playgroud)
但得到错误:
无法将'String'类型的值转换为预期的参数类型'StaticString'
那么如何记录函数参数或任何其他动态数据?