mirror of
https://github.com/passepartoutvpn/wireguard-apple.git
synced 2025-02-20 14:52:16 +00:00
NE: Logging: Log file should begin with version numbers and tunnel name
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
bf86731879
commit
290bd192a0
@ -378,6 +378,7 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 6F5D0C25218352EF000F85AD /* Build configuration list for PBXNativeTarget "WireGuardNetworkExtension" */;
|
||||
buildPhases = (
|
||||
6F61F1EC21BA4D4700483816 /* Extract wireguard-go Version */,
|
||||
6F5D0C16218352EF000F85AD /* Sources */,
|
||||
6F5D0C17218352EF000F85AD /* Frameworks */,
|
||||
6F5D0C18218352EF000F85AD /* Resources */,
|
||||
@ -506,6 +507,25 @@
|
||||
shellScript = "exec make -C \"$PROJECT_DIR/../wireguard-go-bridge\" version-header\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
6F61F1EC21BA4D4700483816 /* Extract wireguard-go Version */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Extract wireguard-go Version";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "exec make -C \"$PROJECT_DIR/../wireguard-go-bridge\" version-header\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
|
@ -42,6 +42,10 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
|
||||
// Configure logging
|
||||
configureLogger()
|
||||
|
||||
wg_log(.info, message: "WireGuard for iOS version \(appVersion())")
|
||||
wg_log(.info, message: "WireGuard Go backend version \(goBackendVersion())")
|
||||
wg_log(.info, message: "Tunnel interface name: \(tunnelConfiguration.interface.name)")
|
||||
|
||||
wg_log(.info, staticMessage: "Starting tunnel")
|
||||
|
||||
// Resolve endpoint domains
|
||||
@ -157,6 +161,17 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
|
||||
}
|
||||
}
|
||||
|
||||
func appVersion() -> String {
|
||||
var appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown version"
|
||||
if let appBuild = Bundle.main.infoDictionary?["CFBundleVersion"] as? String {
|
||||
appVersion += " (\(appBuild))"
|
||||
}
|
||||
return appVersion
|
||||
}
|
||||
|
||||
func goBackendVersion() -> String {
|
||||
return WIREGUARD_GO_VERSION
|
||||
}
|
||||
}
|
||||
|
||||
private func withStringsAsGoStrings<R>(_ str1: String, _ str2: String, closure: (gostring_t, gostring_t) -> R) -> R {
|
||||
|
@ -1 +1,2 @@
|
||||
#include "../../wireguard-go-bridge/wireguard.h"
|
||||
#include "wireguard-go-version.h"
|
||||
|
Loading…
Reference in New Issue
Block a user