Created
March 25, 2015 19:04
-
-
Save prwhite/b95fe6154bd3d559eff2 to your computer and use it in GitHub Desktop.
Simple ObjC augmentation for NSLog to add file, line number and pretty function name. Compiles out in release (assuming DEBUG is not set in release)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef DEBUG | |
#define NSLogDebug(format, ...) \ | |
NSLog(@"<%s:%d> %s, " format, \ | |
strrchr("/" __FILE__, '/') + 1, __LINE__, __PRETTY_FUNCTION__, ## __VA_ARGS__) | |
#else | |
#define NSLogDebug(format, ...) | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment