开发者

saving console messages to file in iphone

开发者 https://www.devze.com 2022-12-11 10:35 出处:网络
Is there any way to save all the console messag开发者_JS百科es to a file in iphone ? ThanksThey go to the system log. You can see it from the organizer in Xcode.

Is there any way to save all the console messag开发者_JS百科es 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.

0

精彩评论

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