Skip to content

Instantly share code, notes, and snippets.

@b-outlaw
Created January 28, 2015 22:26
Show Gist options
  • Save b-outlaw/aec15c6944d2083edea6 to your computer and use it in GitHub Desktop.
Save b-outlaw/aec15c6944d2083edea6 to your computer and use it in GitHub Desktop.
Fancy Logging
#ifndef FancyLog_h
#define FancyLog_h
#define __FANCY_FILE__ [[NSString stringWithUTF8String:__FILE__] lastPathComponent]
#ifndef FancyLog
#ifdef DEBUG
#define FancyLog(fmt, ...) NSLog((@"%s [%@:%d] - " fmt), __PRETTY_FUNCTION__, __FANCY_FILE__, __LINE__, ##__VA_ARGS__);
#else
#define FancyLog( s, ... )
#endif // DEBUG
#endif // FancyLog
#define FANCY_LOG_RECT(msg, f, a) NSLog(@"%@: %f, %f, %f, %f, %f", msg, f.origin.x, f.origin.y, f.size.width, f.size.height, a);
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment