title: iPhone: Once I have redirected NSLog to a file, how do I revert it to the console?
body: <p>I'm using:</p>
  
  <pre><code>#if TARGET_IPHONE_SIMULATOR == 0
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *documentsDirectory = [paths objectAtIndex:0];
      NSString *logPath = [documentsDirectory stringByAppendingPathComponent:@"console.log"];
      freopen([logPath cStringUsingEncoding:NSASCIIStringEncoding],"a+",stderr);
  #endif
  </code></pre>
  
  <p>.. to redirect NSLog to a file, which works great incidentally.</p>
  
  <p>I want to make logging to file something the user of my app can turn on and off.. so does anyone know how I go about redirecting NSLog/stderr <em>back</em> to the console?</p>
  
  <p>Thanks!</p>