console.app messages in OSX 10.8

Brad Garton's icon

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?

thanks --

diablodale's icon

You can see them again by using Max 6.0.8. It is an issue resolved with that update.
http://cycling74.s3.amazonaws.com/support/version_6_0_8.html

Brad Garton's icon

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.

diablodale's icon

use cpost(). This is the Max cross-platform method to get the debug methods into that console app.

Timothy Place's icon

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.

best,
Tim

Brad Garton's icon

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:

printf("applen");
fprintf(stderr, "isn");
FILE *fd = fopen("/dev/console", "w+");
fprintf(fd, "annoying");

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?

Brad Garton's icon

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.