console.app messages in OSX 10.8
Oh joy. I’ve upgraded to Mt. Lion. For some reason, all the handy messages I use for debugging libs I load into max/msp (using printf()) that used to appear in the Console.app no longer get printed. Does anyone know how to see them?
You can see them again by using Max 6.0.8. It is an issue resolved with that update.
Just upgraded, and I’m seeing some of the Max start-up messages in the Console.app (ad_load, sched_start, etc.) but none of the printf()’s that I use in my code are appearing. Where have they gone? Oh Apple… sigh.
Just for fun I tried the old unix trick of "echo ‘hey’ > /dev/console" to see if I could possibly open and use it for console printing. That didn’t work either.
use cpost(). This is the Max cross-platform method to get the debug methods into that console app.
Yeah, Apple wants you to stop using the standard printf() and start using their own NSLog() — which is what cpost() does now in Max 6.0.8.
Thanks guys. Arg, that’s what I was afraid of. Why does Apple do this? Why is the world the way it is?
Unfortunately NSLog() or cpost() won’t work for me. I’m building loadable libs, and all symbols need to be resolved before ld is happy. Since cpost() pre-exists in the environment into which I will be loading my lib, well…
And I’m not using obj-C or Xcode directly (good ole makefile-land for me!), so NSLog() won’t work. I tried all of these:
FILE *fd = fopen("/dev/console", "w+");
but none worked. So there is no way to print from C-land int the Console.app using standard printing tools? Or is anyone aware of a flag I can set when putting together my lib to keep cpost() unresolved for the time being?
Aha! I answered my own question:
ld -U _cpost …
Amazing what one can learn by reading documentation. Apple is still annoying, though, and I’m really disturbed by the developer-direction they seem to be going.