是否有一个流行的开源 NSLog 替代品只能在 DEBUG 和不同的日志级别中处理启用?
是否有许多 iPhone 开发人员正在使用的众所周知/流行的 NSLog 替代/方法?
这是一个处理确保调试类型日志记录仅出现在调试状态(宏等),并支持不同日志级别(DEBUG、WARN、INFO、ERROR 等)的日志记录?
我知道实现这一点可能不需要大量工作,但我很好奇是否有很多 iPhone 开发人员正在使用的流行下载已经解决了这个问题。
Is there a well known / popular NSLog replacement/approach that many iPhone developers are using?
That is one that handles ensuring debug type logging only appears in debug states (macros etc), and support for different log levels (DEBUG, WARN, INFO, ERROR etc)?
I understand there may not be loads of work in implementing this but am curious to know if there is popular download a lot of iPhone developers are using that already solves this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我使用 Marcus Zarra 的 prefix.pch。它曾经位于 http://www. cimgf.com/2010/05/02/my-current-prefix-pch-file/ 但该网站现在已关闭,已复制到此 要点
它没有您想要的那么多级别,但它让您足够了解如何做到这一点。
I use Marcus Zarra's prefix.pch. it used to be at http://www.cimgf.com/2010/05/02/my-current-prefix-pch-file/ but the website is down now, was copied to this gist
It doesn't have as many levels as you want, but it gives you enough of an idea of how you would do it.
CocoaLumberjack 是一个简单但功能强大的日志记录实用程序。只需几行代码,您就可以将所有日志语句发送到控制台或文件,或两者都发送。或者甚至是数据库。
另外,它是完全可定制的。例如,您可以自定义有多少级别。
https://github.com/CocoaLumberjack/CocoaLumberjack
CocoaLumberjack is a simple yet powerful logging utility. With a few lines of code you can send all your log statements to the console or a file, or both. Or even to a database.
Plus it's fully customizable. For example, you can customize how many levels there are.
https://github.com/CocoaLumberjack/CocoaLumberjack
https://github.com/CocoaLumberjack/CocoaLumberjack
即使现在(2011 年 5 月)似乎也很活跃。
https://github.com/CocoaLumberjack/CocoaLumberjack
seems active even now (May 2011).