I've set up logging through OSLog in my iOS App, and I've added a button to export logs with OSLogStore:
extension OSLog {
private static let subsystem = Bundle.main.bundleIdentifier!
@available(iOS 15.0, *)
static func getLogs(inLast: TimeInterval) -> [OSLogEntryLog]? {
guard let store = try? OSLogStore(scope: .currentProcessIdentifier) else { return nil }
let startTime = store.position(timeIntervalSinceEnd: -inLast)
guard let entries = try? store.getEntries(at: startTime).compactMap({ $0 as? OSLogEntryLog }).filter({ $0.subsystem == subsystem }) else { return nil }
return entries
}
}
This works fine when testing locally, all logs are exported even in release builds. However, when our team is testing builds through TestFlight, debug logs are not exported. Is there a way to export all logs including debug logs?