Skip to content

Instantly share code, notes, and snippets.

@avdyushin
Created September 11, 2013 13:00
Show Gist options
  • Save avdyushin/6523246 to your computer and use it in GitHub Desktop.
Save avdyushin/6523246 to your computer and use it in GitHub Desktop.
Nice debug log wrapper for NSLog()
#define __FILE_NAME__ [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String]
#ifdef DEBUG
#define DLog( s, ... ) NSLog( @"%s:%d %s %@", \
__FILE_NAME__, \
__LINE__, \
__PRETTY_FUNCTION__, \
[NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define DLog( s, ... )
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment