Logging: Write versions from both app and extension
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user