Simple, replace all your DEBUG() with iDEBUG() and all DEBUG command output will go to the XCode Console window (Under the "Run" menu). When running your program in Windows it will redirect DEBUG back to the normal console output.
Very simple but handy for seeing some output on the running machine.
// iPhone DEBUG
FUNCTION iDEBUG: debug$
?IFDEF WIN32
DEBUG debug$
?ELSE
INLINE
STDOUT(debug_Str);
ENDINLINE
?ENDIF
ENDFUNCTION
Use...
iDEBUG("This is a test!\n")
... it will work on all platforms.
Some Notes:
Thanks to Trucidare for the heads up on STDOUT.
Actually this will send DEBUG output to the GDB Console on any other platform than Windows, handy for Linux/Mac etc...
Not sure how this would perform is STDOUT has been redirected, say for a console program?
I wanted to wrap it all using "?IFDEF GLB_DEBUG" so that I could use the little debug switch, to turn iPhone console output on and off but it seems to be only defined for debugging in WIN32. Maybe Gernot could add this?
Until then you can do it manually if you want all DEBUG output off by wrapping it in your own preprocesser variable, "MY_DEBUG" for example.
Regarding IPhone, did you check the xcode debugger with the regular debug command?
Yes, the normal GLB DEBUG command does not output anything to the console, even with the XCode debugger on.
What? Then I wonder why I got debug output there.
stdout also works on windows:
IMPORT void __AllocConsole()
__AllocConsole()