ios get programName and processInfo
NSString *programName = [NSString stringWithUTF8String:getprogname()]; //get project name
int pid = [[NSProcessInfo processInfo] processIdentifier]; // get process info
NSString *message = [NSString stringWithFormat:@"%@[%d]", programName,pid];
NSLog(@"-----%@",message);
output:
2017-08-25 16:02:05.775792+0800 test[6676:293674] -----xulinmeiTest[6676]
成功的三大原则:
1、坚持
2、不要脸
3、坚持不要脸