【问题标题】:Handling errors/exceptions & logging them in iPhone applications处理错误/异常并将它们记录在 iPhone 应用程序中
【发布时间】:2011-03-31 18:37:48
【问题描述】:

我想知道当 iPhone 应用程序运行以用于稍后的调试目的时,我们是否需要将异常/错误记录在文件系统的公共文件中?还是IOS通过设备日志自动处理?

我现在使用 NSLog 语句,我们可以在 consol 上打印,但是有没有类似于 Java 中的 log4j 的东西,您可以将所有调试语句(包括错误/异常)放在一个文件中,以便稍后进行分析。

处理这种情况的最佳方法是什么。

【问题讨论】:

    标签: iphone cocoa-touch nserror nsexception


    【解决方案1】:

    在上一篇关于 SO 的帖子中可以找到一些很好的信息:

    Logging to a file on the iPhone

    另一个一般日志记录的好技巧是使用 DLog 宏:

    http://iphoneincubator.com/blog/debugging/the-evolution-of-a-replacement-for-nslog

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-15
      • 1970-01-01
      • 2016-12-31
      • 1970-01-01
      • 2015-03-29
      相关资源
      最近更新 更多