title: Enable and Disable NSLog in DEBUG mode
body: <p>I want to enable NSLog when I am in debug and disable it otherwise. A very simple thing is:</p>
  
  <pre><code>#ifdef DEBUG
  NSLog(@"My log");
  #endif
  </code></pre>
  
  <p>But all this <code>#ifdef</code> and <code>#endif</code> is borring... :( So I try other thing: (.pch is good place to put it)</p>
  
  <pre><code>#ifdef DEBUG
  #   define NSLog(text) NSLog(text);
  #else 
  #   define NSLog(text) 
  #endif
  </code></pre>
  
  <p>This work very fine (isn't recursive). But the problem is that NSLog have infinite arguments.</p>
  
  <pre><code>void NSLog(NSString *format, ...)
  </code></pre>
  
  <p>How I solve this to work in preprocessor mode?</p>
  
  <p>-- Edit -- </p>
  
  <p>This code make your NSLog better: </p>
  
  <pre><code>#ifdef DEBUG
      #define NSLog(FORMAT, ...) fprintf(stderr,"%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
  #else
      #define NSLog(...)
  #endif
  </code></pre>