Skip to content

Instantly share code, notes, and snippets.

@loghound
Created August 27, 2010 07:05
Show Gist options
  • Save loghound/552957 to your computer and use it in GitHub Desktop.
Save loghound/552957 to your computer and use it in GitHub Desktop.
DLog
// Place this in precompile header and in place of NSLog use DLog
// When building in anything other than Debug nothing is logged
// This also provides more logging (so, the NSLog arguments, the method name and the line in code it was called on
// I can't remember where I found this online, but I claim no copyright on this :)
// ALog should be used to log things, regardless of the Build phase
#ifdef DEBUG
#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#define DLog(...)
#endif
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment