Skip to content

Instantly share code, notes, and snippets.

@sbrocket
Created June 27, 2009 21:59
Show Gist options
  • Select an option

  • Save sbrocket/137135 to your computer and use it in GitHub Desktop.

Select an option

Save sbrocket/137135 to your computer and use it in GitHub Desktop.
#ifdef DEBUG
#define debugLog(fmt, ...) NSLog(@"%s (%@:%d) %@", \
__PRETTY_FUNCTION__, \
[[NSString stringWithUTF8String:__FILE__] lastPathComponent], \
__LINE__, \
[NSString stringWithFormat:(s), ##__VA_ARGS__])
#else
#define debugLog(fmt, ...)
#endif
// Sample output:
// -[Class(Category) method] (Filename.m:123) Log message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment