Files
amnezia-client/client/platforms/ios/LogController.swift
T

34 lines
645 B
Swift
Raw Normal View History

2024-02-10 19:44:55 +03:00
import Foundation
public func swiftUpdateLogData(_ qtString: std.string) -> std.string {
let qtLog = Log(String(describing: qtString))
var log = qtLog
2024-04-15 01:04:01 +03:00
if let appLog = Log(at: Log.appLogURL) {
appLog.records.forEach {
log.records.append($0)
}
}
2024-02-10 19:44:55 +03:00
if let neLog = Log(at: Log.neLogURL) {
neLog.records.forEach {
log.records.append($0)
}
2024-04-15 01:04:01 +03:00
}
2024-02-11 01:55:54 +03:00
2024-04-15 01:04:01 +03:00
log.records.sort {
$0.date < $1.date
2024-02-10 19:44:55 +03:00
}
2024-02-11 01:55:54 +03:00
2024-02-10 19:44:55 +03:00
return std.string(log.description)
}
public func swiftDeleteLog() {
2024-04-15 01:04:01 +03:00
Log.clear(at: Log.appLogURL)
2024-02-10 19:44:55 +03:00
Log.clear(at: Log.neLogURL)
}
public func toggleLogging(_ isEnabled: Bool) {
Log.isLoggingEnabled = isEnabled
}