Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSLog() and stderr




On 01/07/2006, at 11:09 AM, Damien Sorresso wrote:

I'm trying to redirect NSLog()'s output to a file. Since it writes to stderr, I should be able to do this with

stderr->_write = my_stderr_write ,

where `my_stderr_write' is a pointer to one of my functions. This works just fine if I use fprintf() to write to stderr, but NSLog() stubbornly refuses to call my function. What exactly is NSLog() doing here that is so special?

From the docs, it suggests that NSLog bypasses the stream and writes directly to the file descriptor? If so, you can redirect the file descriptor using dup2.


-Chris


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >NSLog() and stderr (From: Damien Sorresso <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.