English 中文(简体)
saving console messages to file in iphone
原标题:

Is there any way to save all the console messages to a file in iphone ?

Thanks

最佳回答

They go to the system log. You can see it from the organizer in Xcode.

If you really need the file, you can redirect stderr:

 NSString* myLogfile = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"log.txt"];
 int fd = open([myLogfile fileSystemRepresentation], O_RDWR | O_CREAT, 0664);
 dup2(fd, 2);
问题回答

Copy and paste to a text editor also works, and lets you select just the parts of your current interest.





相关问题
Caching System.Console output

We have some methods that output a lot of coloured text to the Console. It s actually a menu that is built by looping through a collection of data. Because we are writing item by item (and one line ...

console app c++

i m new to console apps and would appreciate some pointers... i have created a new console app and (not finished but it should be working), i selected win32 console app and then selected empty ...

Java prints output twice in a very specific circumstance

System.out.print("My string: "); My string: BUILD SUCCESSFUL (total time: 1 second) System.out.print("My string "); My string BUILD SUCCESSFUL (total time: 1 second) System.out.print("My string: ...

Removing pause after reading using readLine in java

I am reading several lines from the console in a java program using the readLine command from the BufferedReader class. However, the program pauses at the end of the last line and does not proceed ...

热门标签