Aug 14

From the iPhoneDeveloperTips Google Group

In your MyApplication_Prefix.pch file add these lines:

// DO NOT FORGET to add setting GCC_PREPROCESSOR_DEFINITIONS with
value DEBUG=1 to your target's debug configuration !!!!!
// DLog is almost a drop-in replacement for NSLog
// DLog();
// DLog(@"here");
// DLog(@"value: %d", x);
// Unfortunately this doesn't work DLog(aStringVariable); you have to
do this instead DLog(@"%@", aStringVariable);
#ifdef DEBUG
#   define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt),
__PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#   define DLog(...)
#endif
// ALog always displays output regardless of the DEBUG setting
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt),
__PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
Tagged with:
preload preload preload