gpt4 book ai didi

ios - 如何在 Objective C 中将 NSLog 分类为错误、警告、消息和故障类型

转载 作者:行者123 更新时间:2023-11-29 11:47:53 24 4
gpt4 key购买 nike

我们正在开发 iOS 应用程序。我们要创建 NSLog 的自定义类,它将定义四种类型的消息 iOS 应用系统,如

1. Error
2. Fault
3. Info message
4. Warnings

是否有一些 Apple 标准文档来创建此类消息定义或如何为我们的 App 日志消息创建特殊情况?

最佳答案

这是不可能用 NSLog() 完成的。

如果您想使用日志级别,您应该在 iOS 10+ 上使用 libtrace 中的 os_log() 或在早期版本上使用 ASL。

参见 https://developer.apple.com/documentation/os/logging

关于ios - 如何在 Objective C 中将 NSLog 分类为错误、警告、消息和故障类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42619298/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com