• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Where does printf go?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where does printf go?


  • Subject: Re: Where does printf go?
  • From: Alexander von Below <email@hidden>
  • Date: Tue, 28 Oct 2014 13:52:17 +0100

Hello,

I have not tried it out in code, but generally, printf goes to "standard out" STDOUT_FILENO (whereas NSLog goes to STDERR_FILENO)

You can redirect all of your output into a file, for example:

- (void) redirectSTDOUT {
    NSError *error;
    self.fileHandle = [NSFileHandle fileHandleForWritingToURL:self.tmpFileURL error:&error];
    self.fileDescriptor = [self.fileHandle fileDescriptor];

    dup2(self.fileDescriptor, STDOUT_FILENO);
}

Now, all of your stdout code will go to into a file.

While this does not exactly answer your question, maybe it helps

Alex

Am 28.10.2014 um 11:13 schrieb Jonathan Taylor <email@hidden>:

> This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Where does printf go?
      • From: "Glenn L. Austin" <email@hidden>
References: 
 >Where does printf go? (From: Jonathan Taylor <email@hidden>)

  • Prev by Date: Where does printf go?
  • Next by Date: Re: Where does printf go?
  • Previous by thread: Where does printf go?
  • Next by thread: Re: Where does printf go?
  • Index(es):
    • Date
    • Thread