Mac 应用程序的标准输出在哪里?

发布于 2024-08-19 20:32:16 字数 273 浏览 5 评论 0原文

过去,stdout 会转到控制台日志,由 Console.app 显示。我在使用 Firefox 插件时遇到了一些问题(请参阅其他问题,对垃圾邮件感到抱歉...),并且我尝试使用 printfs 至少看看我是否正在启动我的插件。

我今天才注意到我的控制台日志自 1 月 6 日以来就没有更新过。(是的,过去一个月我一直在使用这台机器。)现在,我不是唯一使用控制台日志的程序,所以所有这些消息一定会被发送到其他地方。

有谁知道在哪里吗?

问题是 syslogd 损坏了。现在已经修好了。

It used to be that stdout went to the console log, displayed by Console.app. I've been having some problems with a firefox plugin (see other questions, sorry about the spam...) and I was trying to use printfs to at least see if I was STARTING my plugin.

I just noticed today that my console log hasn't been updated since January 6. (Yes, I've been using the machine for the past month.) Now, I'm not the only program that uses the console log, so all those messages must be going SOMEWHERE else.

Does anyone know where?

The problem was that syslogd was broken. It's fixed now.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冷夜 2024-08-26 20:32:16

解决方案:问题不在于标准输出没有进入控制台。问题是控制台没有被写入,因为 syslogd 被窃听了。由于某种原因,Syslogd 被沙箱化,因此自 1 月 6 日以来,没有任何内容被写入控制台。

解决方案是重新注释掉 LaunchDaemons/com.apple.syslogd 的“如果您想要对 syslogd 进行沙箱化,请取消注释”部分。 plist。

解决方案来自 superuser.com....
谢谢!

Solution: the problem wasn't that stdout wasn't going to the console. The problem was that the console wasn't getting written to because syslogd was buggered. Syslogd was being sandboxed for some reason, and so NOTHING had been written to the console since January 6.

the solution was to re-comment out the "uncomment this if you want to sandbox syslogd" section of LaunchDaemons/com.apple.syslogd.plist.

The solution came from superuser.com....
thanks!

旧伤还要旧人安 2024-08-26 20:32:16

printf 应该转到 Console.app。听起来你的坏了。

调试插件的一个好方法是将 FireFox 设置为 XCode 项目的自定义可执行文件,并在调试器中运行。然后 XCode 控制台将捕获输出。
在这种情况下,您也只需使用断点来查看插件是否正在加载,而不是 printf。

printf should be going to the Console.app. It sounds like yours is broken.

A good way to debug your plugin would be to set FireFox as your XCode project's Custom Executable, and run in the debugger. Then the XCode Console would catch the output.
In that case you also just use a breakpoint to see if your plugin was loading instead of printf.

启动应用程序并运行“lsof | grep”后它显示文件描述符 0、1 和 2 都是 /dev/null

After starting an app and running "lsof | grep <program_name>" it shows file descriptors 0, 1 and 2 are all /dev/null

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文