Is there a way to read what NSLog is writing from within the app?
- by Jared P
I have already tried
stderr = stdout = fopen("/Users/Jared/Desktop/Untitled.txt", "w");
just as a test (obvi not production code) and this works fine for printf and some errors, but fails to redirect NSLog. I would like to be able to read what is being sent to NSLog as a string, and preferably prevent it from actually going into the system logs, although I don't particularly care if it has to. I need it to redirect logging from both my own code and apple's frameworks, which is why I can't just write a function that would append logs to a string.
Thanks