I am using new os.log
thing for logging in my app as follows:
import os.log
class ViewController: UIViewController {
// a bunch of methods
}
extension OSLog {
static let ui = OSLog(subsystem: "io.my.app", category: "ui")
}
extension ViewController {
func upload(locations: [LocationProtocol]) {
os_log("Sending locations to server", log: .ui, type: .debug)
self.server_api.send(locations)
}
}
The logs are shown in Console.app
as expected when I am debugging the app from Xcode. But is it possible to somehow retrieve logged strings from an app's instance deployed on a device? I am testing my app "in the field", away from the laptop, and wanted to dump gathered logs into a text file.
Do I need to configure loggers somehow to persistently store logs, or it is only possible to get crash reports from a deployed app?
Note: I am using Swift 4 / Xcode 9+