Hi folks,
in my application I write some logs over debugPrint or directly over print.
The application is already distributed and some part of functionality failed with application traceback.
I would like to ask user for providing logs from the App. Is it possible to get those logs?
Thanks Petr
Thanks for the post, the logs with print will go to your Xcode console while you are debugging. All those are meant to find the issue before releasing the app.
After release you cannot retrieve logs written via print or debugPrint from a distributed app after the fact for privacy.
In Swift, print and debugPrint output directly to standard output (stdout). While this shows up in Xcode when the debugger is attached.
Since you mentioned the app failed with a traceback, the operating system likely generated a Crash Report. You can ask the user to retrieve this specific crash log.
If you want to be able to retrieve logs from users in the future, I would switch to Unified Logging System or a file-based logger and you can ask trusted users to provide you with the sysdiagnose that will contain those logs as Logger API writes to the system's unified logging facility, which persisted to disk and can be retrieved with user’s permission.
Hope this helps. Inviting other developers for their ideas an suggestions.
Albert Worldwide Developer Relations.