xcode 适用于 iOS 的记录器库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10819785/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Logger Library for iOS
提问by Charith Nidarsha
Is there any good logger library for iOS development like log4J in Java?
有没有像 Java 中的 log4J 这样的 iOS 开发好的记录器库?
I found log4cocoa. But its not updated in years now.
我找到了 log4cocoa。但它现在几年没有更新了。
回答by iTukker
I have not checked them all, but may be this helps:
我还没有全部检查过,但这可能有帮助:
GTMLogger (google-toolbox-for-mac)
回答by levous
I've used https://github.com/robbiehanson/CocoaLumberHymanwith much success. Its an easy, drop in replacement for NSLog and allows you to change log levels. I did struggle with setting up a global log level (as opposed to per file) and changing log levels at runtime as that wasn't well documented. Its been a while, though, so perhaps that's been improved. Nonetheless, it produced excellent log files that I was able to use for troubleshooting in the wild.
我已经成功地使用了https://github.com/robbiehanson/CocoaLumberHyman。它是 NSLog 的简单替代品,并允许您更改日志级别。我确实在设置全局日志级别(而不是每个文件)和在运行时更改日志级别方面遇到了困难,因为这没有得到很好的记录。不过,它已经有一段时间了,所以也许已经有所改善。尽管如此,它生成了出色的日志文件,我可以使用这些文件在野外进行故障排除。