MTLog
MTLog copied to clipboard
NSLog(@"_route:file(log.txt,append)") More Times ,file write repeat
-(IBAction)actionSaveToFile:(id)sender { NSLog(@"_route:file(log.txt,append)");
NSLog(@"Message 1");
NSLog(@"Message 2");
NSString* logPath = [(MTLogPluginRoute*)[MTLog pluginsByName:@"route"].firstObject logFilePath];
[[[UIAlertView alloc] initWithTitle:@"Log file saved"
message:[NSString stringWithFormat:@"The log file is located at %@", logPath]
delegate:nil
cancelButtonTitle:@"Close"
otherButtonTitles:nil] show];
NSLog(@"_remove:_route:file(log.txt)");
}
tap this twice ,The log file will be this:
--- 2014-05-17 05:39:14 +0000 ---- New log entry ---- ViewController.m:65 > Message 1 ViewController.m:66 > Message 2 --- 2014-05-17 05:39:19 +0000 ---- New log entry ---- ViewController.m:65 > Message 1 ViewController.m:65 > Message 1 ViewController.m:66 > Message 2 ViewController.m:66 > Message 2