Advertisement
priore

Loggin (NSLog) only in Debug mode

Jul 8th, 2012
851
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // first define -DDEBUG=1 in Target --> Build Settings --> Other C Flags
  2. // after define the macro below in .PCH file of your project
  3. // and use it in the same way of NSLog.
  4.  
  5. #ifdef DEBUG
  6.     #define LLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
  7. #else
  8.     #define LLog( s, ... )
  9. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement