Skip to content

Instantly share code, notes, and snippets.

@christianroman
Last active December 27, 2015 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christianroman/7238676 to your computer and use it in GitHub Desktop.
Save christianroman/7238676 to your computer and use it in GitHub Desktop.
Personal use debugging macros
#ifdef DEBUG
#define DLog(...) NSLog(__VA_ARGS__)
#else
#define DLog(...) /* */
#endif
#define ALog(...) NSLog(__VA_ARGS__)
#ifdef DEBUG
#define DLog(format, ...) NSLog((@"%s [Line %d] " format), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#define DErr(format, ...) NSLog((@"[ERROR] %s [Line %d] " format), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#define DLogRect(rect, ...) DLog(@"%s: %@", #rect, NSStringFromCGRect(rect))
#define DLogSize(size, ...) DLog(@"%s: %@", #size, NSStringFromCGSize(size))
#else
#define DLog(format, ...)
#define DErr(format, ...)
#define DLogRect(rect, ...)
#define DLogSize(size, ...)
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment