diff options
author | Roopesh Chander <roop@roopc.net> | 2018-12-13 18:09:38 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2018-12-13 18:09:38 +0530 |
commit | efd4b28a0de81a41c0d821300989bbd05ffa21c2 (patch) | |
tree | 6ed980dc737633bc46b9a3e9a08ac050a68f8e7c /WireGuard/Shared | |
parent | Logging: file_log doesn't need the message type (diff) | |
download | wireguard-apple-efd4b28a0de81a41c0d821300989bbd05ffa21c2.tar.xz wireguard-apple-efd4b28a0de81a41c0d821300989bbd05ffa21c2.zip |
Logging: Write versions from both app and extension
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/Shared')
-rw-r--r-- | WireGuard/Shared/Logging/Logger.swift | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/WireGuard/Shared/Logging/Logger.swift b/WireGuard/Shared/Logging/Logger.swift index 88df246..7df162a 100644 --- a/WireGuard/Shared/Logging/Logger.swift +++ b/WireGuard/Shared/Logging/Logger.swift @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT // Copyright © 2018 WireGuard LLC. All Rights Reserved. +import Foundation import os.log class Logger { @@ -32,6 +33,15 @@ class Logger { } } +func wg_log_versions_to_file() { + var appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown version" + if let appBuild = Bundle.main.infoDictionary?["CFBundleVersion"] as? String { + appVersion += " (\(appBuild))" + } + let goBackendVersion = WIREGUARD_GO_VERSION + file_log(message: "App version: \(appVersion); Go backend version: \(goBackendVersion)") +} + func wg_log(_ type: OSLogType, staticMessage msg: StaticString) { // Write to os log os_log(msg, log: OSLog.default, type: type) |