Rewrite Logger

This reverts all of Roop's changes to the C code, and then rewrites the
logger logic to be cleaner.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2018-12-13 15:26:04 +01:00
parent 38accad27d
commit 642b627d27
6 changed files with 87 additions and 115 deletions
+1 -11
View File
@@ -12,17 +12,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication,
willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
if let appLogFilePath = FileManager.appLogFileURL?.path {
if !Logger.configure(withFilePath: appLogFilePath) {
os_log("Can't open log file for writing. Log is not saved to file.", log: OSLog.default, type: .error)
}
} else {
os_log("Can't obtain log file URL. Log is not saved to file.", log: OSLog.default, type: .error)
}
wg_log(.info, message: "Launching app")
wg_log_versions_to_file()
Logger.configureGlobal(withFilePath: FileManager.appLogFileURL?.path, withTag: "APP")
let window = UIWindow(frame: UIScreen.main.bounds)
window.backgroundColor = UIColor.white