Does Cocoa Touch provide a convenient way for apps to perform logging? Perhaps something similar to the print() command except it is kept after the app is installed?
app logging
Kept where?
NSLog outputs to the console. os_log is the more modern approach.
If you need to save logs to a file in the app sandbox, you will have to roll your own (it’s not hard) or find a 3rd party approach.
I don't know where I would keep it? Probably in the app sandbox but somewhere where I can access it from the user's device.
You can’t really access a user’s device from the outside. But you can ask a user to email files.
And if you just want to get console logs, you could use a server-based solution (such as BugFender).
I don't understand what you mean by "console logs". Which console are you talking about. If the log is supposed to log an app's performance on a user's device, there is no console on the user's device.
If you do a print or NSLog on a device, the output goes to the console. (You can also see all the logging by attaching the device to Xcode, and opening the Devices & Simulators window.)
My guess is the answer to your original question is "no" and you should write your own file and figure a way to get it off the device.
I am resuming this thread because I have the same question as this one that I posted. I did a search on the Internet to answer a question and I found this old post that I posted.
I think the problem is I don’t understand what you’re referring to when you say “console”. Is that an app on macOS? Wouldn’t I be able to get this information if the user installed the app using TestFlight? I think there’s things I haven’t thought through I don’t understand, so my question doesn’t really make sense.