News for hackers. Stuff that matters.
Re:Try Objective-C by danenania on Thursday May 09, 2013 @09:24PM (#5684009)
A good solution to this is to use always use a debug-mode dependent macro for logging[1]:

#ifdef DEBUG

#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt),__PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)

#else

# define DLog(...)

#endif

Put that in your [Project]-Prefix.pch file to make it available globally. Aside from letting you log without fear, it gives you better performance in production, and you can get extra context for your output.

1: http://stackoverflow.com/questions/969130/how-to-print-out-t...

There are no comments on this comment yet.