Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经尝试在 Xcode 12.5 和 13 版本中使用 OSLog 每个文档,但都失败了:
OSLog 应该如何工作?我看不出我做错了什么。
你应该使用这个
Logger.info(.....
在不在struct级别的函数或块内,例如
struct
struct ContentView: View { let logger = Logger() let x = 12 var body: some View { Text("Hello, world!") .padding().onTapGesture { logger.info("This is a message \(x)") } } }