Skip to content

Instantly share code, notes, and snippets.

@mikekatz
Created March 22, 2013 19:27
Show Gist options
  • Save mikekatz/5224025 to your computer and use it in GitHub Desktop.
Save mikekatz/5224025 to your computer and use it in GitHub Desktop.
Debugging Log macros from a PCH of a recent app. Note that it uses TFLog to log to testFlight, so this is still for in-test, not app store release.
#if DEBUG
#define AssertLog(condition, desc, args...) NSAssert(condition, desc, ## args)
#define DBLog(format, args...) TFLog(@"%s, line %d: " format "\n", __func__, __LINE__, ## args);
#else
#define AssertLog(c, desc, args...) if (!(c)) TFLog(@"%s, line %d: " desc "\n", __func__, __LINE__, ## args);
#define DBLog(format, args...) do {} while(0)
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment