To redirect the log statements to a file instead of console call the following function at the start of function applicationDidFinishLaunching.
- (void)redirectConsoleLogToDocumentFolder
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *logPath = [documentsDirectory stringByAppendingPathComponent: @"filename.log"];
freopen([logPath fileSystemRepresentation],"a+",stderr);
}
0 Comment(s)