Tag:nslog

  • Timing of controlling nslog output in IOS

    Time:2021-1-9

    -(void)saveDEBUGlog{ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentDirectory = [paths objectAtIndex:0]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@”yyyy_MM_dd_HH_mm_ss”]; NSString *currentDateStr = [dateFormatter stringFromDate:[NSDate date]]; NSString *fileName = [NSString stringWithFormat:@”testLog_%@.log”,currentDateStr]; NSString *logFilePath = [documentDirectory stringByAppendingPathComponent:fileName]; //Delete the existing file first NSFileManager *defaultManager = [NSFileManager defaultManager]; [defaultManager removeItemAtPath:logFilePath error:nil]; //Input log to file freopen([logFilePath cStringUsingEncoding:NSASCIIStringEncoding], […]

  • Log synchronization in IOS to obtain nslog redirection and other details

    Time:2020-12-18

    preface For those engineers who do back-end development, it should be a matter of course to watch logs and solve bugs. However, many of the mobile application development engineers I have contacted do not have this awareness. When checking bugs, they always try to reproduce and debug, especially for some bugs that are not easy […]

  • IOS a flexible and extensible open source log Library

    Time:2019-12-2

    At present, most IOS small development teams don’t pay much attention to log, which makes it difficult to troubleshoot many online or user feedback bugs. For app, a good log system can help us troubleshoot some difficult bugs at the lowest cost. The only thing we need to do is to print logs in the […]