aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/AppDelegate.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-12-13 15:38:10 +0530
committerRoopesh Chander <roop@roopc.net>2018-12-13 17:37:14 +0530
commitae7fb7323faf6321d07dd855ea4f7641d2424ec0 (patch)
treee06c8af688ca2de4c0464b7d206a140d9cf92f3d /WireGuard/WireGuard/UI/iOS/AppDelegate.swift
parentAvoid using 'VPN' in code where possible (diff)
downloadwireguard-apple-ae7fb7323faf6321d07dd855ea4f7641d2424ec0.tar.xz
wireguard-apple-ae7fb7323faf6321d07dd855ea4f7641d2424ec0.zip
Logging: Use ringlogger for logging from the extension
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/AppDelegate.swift')
-rw-r--r--WireGuard/WireGuard/UI/iOS/AppDelegate.swift8
1 files changed, 8 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/AppDelegate.swift b/WireGuard/WireGuard/UI/iOS/AppDelegate.swift
index 1a4f15c..5625814 100644
--- a/WireGuard/WireGuard/UI/iOS/AppDelegate.swift
+++ b/WireGuard/WireGuard/UI/iOS/AppDelegate.swift
@@ -13,6 +13,14 @@ 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)
+ }
+
let window = UIWindow(frame: UIScreen.main.bounds)
window.backgroundColor = UIColor.white
self.window = window