0

I have an application that has been successfully logging std::cout messages from my Objective-C application (with numerous open source and in house c++ base libraries) on 10.6 and 10.7 for several years.

I have a few users running 10.8 now, and the same std::cout messages that work without issue on older OSX revisions no longer appear at all in Mountain Lion.

I found a thread elsewhere that indicates cout messages no longer go to console in 10.8, only NSlog messages are sent to the console now. Is this true? If not, any other debug suggestions? If so, is there a work around?

Even if I changed my entire code base to NSlog, I can't do anything about the c++ libraries I use.

Evan
  • 2,441
  • 23
  • 36
  • I don't know where you heard about that NSLog thing, because cout still works fine for me. I would try recompiling to see if that happens on you computer. – Chris Loonam Mar 29 '13 at 22:02
  • Perhaps you should provide a link to the thread you are talking about. That behavior is confirmed here: http://stackoverflow.com/questions/13104588/how-to-get-stdout-into-console-app. – Martin R Mar 29 '13 at 22:05
  • @Martin R The thread I was talking about is not on SO. Here is the link, anyway: http://cycling74.com/forums/topic.php?id=43753. I completely missed the one you linked to while searching, so thanks for the confirmation. Still hoping for a work around. – Evan Mar 29 '13 at 22:14
  • @Chris Loonam What rev of OSX are you using? Also, what Xcode version and OSX SDK are you targeting? Thanks! – Evan Mar 29 '13 at 22:16
  • @Evan I'm also on 10.8 and on the latest Xcode version and SDK – Chris Loonam Mar 29 '13 at 22:25
  • @ChrisLoonam Maybe this has to do with with build I'm supporting being on the 10.6 SDK then? I may trying recompiling a version against the 10.8 SDK. My development machine is still on 1.7, as well, so that will need an upgrade first, I assume. The laptop I'm having trouble with is on 10.8.3. – Evan Mar 29 '13 at 22:38
  • You can always replace `stderr` and `stdout` with, e.g., a pipe serviced by a thread that just waits on the pipes and syslogs what it sees. Or do the equivalent from an outside wrapper executable (which can probably even just be `sh` using a shell pipe). Or, of course, while debugging your app, run the executable directly in a terminal window (or launch in the Xcode debugger), instead of launching the app as an app. – abarnert Mar 29 '13 at 23:16

0 Answers0