xcode 如何将 printf 输出定向到与 NSLog 相同的目标?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14387107/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 02:32:42  来源:igfitidea点击:

How to direct printf output to the same target as NSLog?

iosxcodeloggingprintfnslog

提问by Matti Jokipii

How can i make the output of printf appear in the Xcode Organizer console view? While debugging on a connected device i can see printf output right among NSLog output in th debug console in Xcode, but i can see only NSLog output on the Organizer console.

如何让 printf 的输出出现在 Xcode Organizer 控制台视图中?在连接的设备上调试时,我可以在 Xcode 的调试控制台中的 NSLog 输出中直接看到 printf 输出,但我只能在 Organizer 控制台上看到 NSLog 输出。

I'm developing in Objective-C++ and use printf for logging pure c++ code. Ultimately i wish to have this output from the app available from the time the device has been disconnected.

我正在使用 Objective-C++ 进行开发,并使用 printf 来记录纯 C++ 代码。最终,我希望从设备断开连接时起就可以使用该应用程序的输出。

回答by Rostyslav Druzhchenko

There isdescription how to achieve it. It looks like there is no another ability to direct printfto Organizer.

描述如何实现它。似乎没有其他功能可以直接printf指向 Organizer。