开发者

How can I redirect all output to system.log to my own log?

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);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜