So I already rolled my own custom logging function, which works quite well. But error messages are still being printed to system.log.
I've been googling around a bit and I've seen mentions of redirected stderr, but I开发者_StackOverflow haven't actually seen any examples on how to do this. Does anyone have any insight into how I can achieve this? (And is simply closing the stderr file descriptor + re-opening it the solution?)
I want to be capturing messages like "unrecognized selector sent to instance 0x15a918a0" etc...
freopen(myLogFile,"a+",stderr);
精彩评论