是否可以为 XCode 设置日志样式
现在我使用 NSLog()
在 IDE 中进行调试,是否可以在 Xcode 中设置 Log 样式?
示例
- 为日志 XML、JSON 输出着色
- 在日志控制台样式中
Now I was use NSLog()
for debugging inside IDE, Is it possible to styling Log in Xcode ?
Example
- Coloring Log
- XML, JSON Output in Log console Styling
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 XcodeColors xcode 插件对 Xcode 控制台中的日志语句进行着色:
https://github.com/robbiehanson/XcodeColors
与 CocoaLumberjack 结合使用非常容易:
https://github.com/robbiehanson/CocoaLumberjack/wiki/XcodeColors
例如,使用Lumberjack,一行代码允许您设置所有错误消息的颜色。您可以将它们显示为红色,以便可以轻松地将它们与其他调试日志记录区分开来。
You can use the XcodeColors xcode plugin to colorize log statements in the Xcode console:
https://github.com/robbiehanson/XcodeColors
It's very easy to use in combination with CocoaLumberjack:
https://github.com/robbiehanson/CocoaLumberjack/wiki/XcodeColors
For example, with Lumberjack, one line of code allows you to set the color for all error messages. You could make them show up in red so they're easily distinguishable from other debug logging.