views:

83

answers:

1

I observed Android programmers using LogCat to see colored Debugger Console output. It looks like you can have different classes do their debug output in different colors. Is this possible when developing for iPhone?

A: 

You can log with tags to your own file, and open it with an editor that shows colors for the tags.

I do not think it is possible to show colors using the default logger.

You can define a custom logging function to write tags automatically for the colors, take a look here, it may be a starting point.

Good luck!

dkk
thanks for the idea. the linked site doesn't have anything to do with colors; it's just about having your own preprocessor #define for adding function/line info to the debug output. this is something that i already do (and the implementation i'm using is more advanced than the one in the article).what's an example of an editor that shows colors for tags?do i need to write to a file manually (i.e. write code in my app that does it)?
Elliot
In mac you can use Smultron for coloring syntax (if you are on windows or linux I'd use Notepad++). You can just use tags of an existing language syntax or define your custom syntax coloring (would probably be much better).Yes, you will have to write code for writing to the log file.
dkk
It seems that you can use freopen to log to a file. See http://stackoverflow.com/questions/202299/logging-to-a-file-on-the-iphoneandhttp://www.cocoadev.com/index.pl?NSLogToFile
dkk