Posted By

ikex on 02/21/10


Tagged

iphone CocoaTouch


Versions (?)

Who likes this?

9 people have marked this snippet as a favorite

gummiball
umang_nine
avanadra
dannolan
sb
barneymc
wpellis
Tintenklecks
cnathan


A better logging solution


 / Published in: Objective C
 

  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  

You need to login to post a comment.