Skip to content

Instantly share code, notes, and snippets.

@stith
Created January 3, 2011 02:12
Show Gist options
  • Save stith/763037 to your computer and use it in GitHub Desktop.
Save stith/763037 to your computer and use it in GitHub Desktop.
MSLog code
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Debug
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define DEBUG_ON // Toggle to DEBUG_OFF or comment out to hide all debug code
#ifdef DEBUG_ON
#define MSLog(format, ...) CFShow([[NSString stringWithFormat:@"<%@:%d> ",[[NSString stringWithUTF8String:__FILE__] lastPathComponent],__LINE__] stringByAppendingFormat:format, ## __VA_ARGS__])
#else
#define MSlog(format, ...)
#endif
#define MSLogRect(rect) MSLog(@"%s x:%.4f, y:%.4f, w:%.4f, h%.4f", #rect, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)
#define MSLogSize(size) MSLog(@"%s w:%.4f, h:%.4f", #size, size.width, size.height)
#define MSLogPoint(point) MSLog(@"%s x:%.4f, y:%.4f", #point, point.x, point.y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment