views:

159

answers:

1

Hi,

i need a simple logging solution while writing Cocoa/OpenGL application in C++.

I'd like:

cout << "debug line" << endl;

to open a console window and show the text. Is it possible?

I'm using XCode, maybe it has some logging utility in debug mode?

Thanks in advance,

Etam.

+1  A: 

Do you actually need the console window opened for you automatically, or do you just need debugging output that you have access to? If the latter, just use NSLog() and your output should show up in the console. e.g.:

NSLog(@"Debug line.");

You can open a console window in XCode by choosing Run->Console, or typing shift-cmd-R.

peterb
Before I knew of NSLog, I used printf("A: %s\n", [var UTF8String]);
mcandre
Thanks, cout works fine in this thing :).
etam