Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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)
#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
You can’t perform that action at this time.