A better logging solution

/ Published in: Objective C
Save to your folder(s)

Copy this code and paste it in your HTML
  1. // Macro voodo? Will not be printed if application is build with -DPRODUCTION
  2. // Ex. Log(@"String with %s", @"Formatting");
  3. #ifndef PRODUCTION
  4. #define Log(format, ...) \
  5. NSLog(@"(%s)[%s:%d] %s", __FUNCTION__,__FILE__,__LINE__, [[NSString stringWithFormat:format, ##__VA_ARGS__] UTF8String])
  6. #else
  7. #define Log(format, ...) /* NOT USED IN PRODUCTION */
  8. #endif

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.