os_log("Can't obtain shared folder URL", log: OSLog.default, type: .error)
return nil
}
- return sharedFolderURL.appendingPathComponent("lastActivatedTunnelLog.txt")
+ return sharedFolderURL.appendingPathComponent("last-activated-tunnel-log.txt")
}
static func deleteFile(at url: URL) -> Bool {
func activateOnDemandOptionText(for activateOnDemandOption: ActivateOnDemandOption) -> String {
switch (activateOnDemandOption) {
case .none:
- return ""
+ return "Off"
case .useOnDemandOverWiFiOrCellular:
- return "Over WiFi or cellular"
+ return "Wi-Fi or cellular"
case .useOnDemandOverWiFiOnly:
- return "Over WiFi only"
+ return "Wi-Fi only"
case .useOnDemandOverCellularOnly:
- return "Over cellular only"
+ return "Cellular only"
}
}
let dateFormatter = ISO8601DateFormatter()
dateFormatter.formatOptions = [.withFullDate, .withTime, .withTimeZone] // Avoid ':' in the filename
let timeStampString = dateFormatter.string(from: Date())
- let destinationURL = destinationDir.appendingPathComponent("WireGuard_iOS_log_\(timeStampString).txt")
+ let destinationURL = destinationDir.appendingPathComponent("wireguard-log-\(timeStampString).txt")
if (FileManager.default.fileExists(atPath: destinationURL.path)) {
let isDeleted = FileManager.deleteFile(at: destinationURL)
try FileManager.default.copyItem(at: networkExtensionLogFileURL, to: destinationURL)
} catch {
os_log("Failed to copy file: %{public}@ to %{public}@: %{public}@", log: OSLog.default, type: .error, networkExtensionLogFileURL.absoluteString, destinationURL.absoluteString, error.localizedDescription)
- ErrorPresenter.showErrorAlert(title: "No log available", message: "The log could not be accessed", from: self)
+ ErrorPresenter.showErrorAlert(title: "Log export failed", message: "The log could not be copied", from: self)
return
}
case .none:
detailText = "Off"
case .useOnDemandOverWiFiOrCellular:
- detailText = "WiFi or cellular"
+ detailText = "Wi-Fi or cellular"
case .useOnDemandOverWiFiOnly:
- detailText = "WiFi only"
+ detailText = "Wi-Fi only"
case .useOnDemandOverCellularOnly:
detailText = "Cellular only"
}