Skip to content

Instantly share code, notes, and snippets.

@jacksonfdam
Created May 25, 2012 21:24
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 jacksonfdam/2790681 to your computer and use it in GitHub Desktop.
Save jacksonfdam/2790681 to your computer and use it in GitHub Desktop.
Debugging Macros
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Debug
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define DEBUG_ON // Toggle to DEBUG_OFF to hide all debug code
#ifdef DEBUG_ON
#define debug(format, ...) CFShow([NSString stringWithFormat:format, ## __VA_ARGS__]);
#else
#define debug(format, ...)
#endif
#define debugRect(rect) debug(@"%s x:%.4f, y:%.4f, w:%.4f, h%.4f", #rect,
rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)
#define debugSize(size) debug(@"%s w:%.4f, h:%.4f", #size, size.width, size.height)
#define debugPoint(point) debug(@"%s x:%.4f, y:%.4f", #pt, pt.x, pt.y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment