开发者

Where is stdout for a Mac App?

开发者 https://www.devze.com 2022-12-18 20:50 出处:网络
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

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.


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!


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号