-1

I'm getting json data in my NSlog in Xcode using following code

NSString *jsonStr = [[NSString alloc] initWithData:activityData encoding:NSUTF8StringEncoding];
NSLog(@"Sync Json:%@",jsonStr); 

So if I have to get the same json data in my device log which can be sent as a text file as an email.

user3452
  • 349
  • 5
  • 20
  • Possible duplicate of [Logging data on device and retrieving the log](https://stackoverflow.com/questions/9097424/logging-data-on-device-and-retrieving-the-log) – trungduc Jul 26 '18 at 04:25
  • What “device log” are you talking about? If you want to write to a file, write to it. There is no log file that you can retrieve. – matt Jul 26 '18 at 04:28

2 Answers2

0

NSLogs will be in your device logs when building in release mode (production app). No further action is required by you.

Albert Renshaw
  • 17,282
  • 18
  • 107
  • 195
0

I used this code to fix my issue

[[DBHelper getSharedInstance] AddLogFile:[NSString stringWithFormat:@"Sync Json:%@",jsonStr]];

which sends the NSLog to my device log file.

user3452
  • 349
  • 5
  • 20