开发者

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

开发者 https://www.devze.com 2023-02-19 13:31 出处:网络
So I already rolled my own custom logging function, which works quite well.But error messages are still being printed to system.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

精彩评论

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