Forums > Dev

console.app messages in OSX 10.8

November 18, 2012 | 11:22 pm

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 –

brad

http://music.columbia.edu/~brad


November 20, 2012 | 12:19 am

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


November 20, 2012 | 12:48 am

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.

brad

http://music.columbia.edu/~brad


November 21, 2012 | 11:51 am

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


November 21, 2012 | 12:02 pm

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


November 23, 2012 | 3:24 pm

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

http://music.columbia.edu/~brad


November 23, 2012 | 4:30 pm

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.

brad

http://music.columbia.edu/~brad


Viewing 7 posts - 1 through 7 (of 7 total)