mirror of
https://github.com/confirmedcode/Lockdown-iOS.git
synced 2025-12-21 12:14:02 +01:00
feat: add proper timestamp to PacketTunnelProviderLogs
This commit is contained in:
@@ -56,9 +56,17 @@ func getUserWantsVPNEnabled() -> Bool {
|
||||
|
||||
enum PacketTunnelProviderLogs {
|
||||
|
||||
static let dateFormatter: DateFormatter = {
|
||||
$0.dateFormat = "yyyy-MM-dd HH:mm:ss"
|
||||
$0.formatterBehavior = .behavior10_4
|
||||
$0.locale = .init(identifier: "en_US_POSIX")
|
||||
return $0
|
||||
}(DateFormatter())
|
||||
|
||||
static let userDefaultsKey = "com.confirmed.lockdown.ne_temporaryLogs"
|
||||
|
||||
static func log(_ string: String) {
|
||||
let string = "\(dateFormatter.string(from: Date())) \(string)"
|
||||
if var array = defaults.stringArray(forKey: userDefaultsKey) {
|
||||
array.append(string)
|
||||
defaults.setValue(array, forKey: userDefaultsKey)
|
||||
|
||||
Reference in New Issue
Block a user