Skip to content

Instantly share code, notes, and snippets.

@divanvisagie
Last active December 11, 2015 03:48
Show Gist options
  • Save divanvisagie/4540622 to your computer and use it in GitHub Desktop.
Save divanvisagie/4540622 to your computer and use it in GitHub Desktop.
I have noticed a lot of people seem to go to very unnecessary lengths to strip NSlogs (see Insane.mm) , where all thats required is something simple. Rule of Clarity: Clarity is better than cleverness - https://en.wikipedia.org/wiki/Unix_philosophy
/* who would do this ? , its insane */
#ifdef DEBUG
#define DMLog(...) NSLog(@"%s%@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
#else
#define DMLog(...) do { } while (0)
#endif
/* Keep it simple */
#ifndef DEBUG
#define NSLog(...) {}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment