Use a distinct debug log per VPN protocol (#277)
Log content from different tunnels was interleaved. Store debug logs in a protocol-specific folder.
This commit is contained in:
parent
44e0ca9127
commit
6fd1f96e54
|
@ -58,7 +58,9 @@ extension Profile.OpenVPNSettings: VPNConfigurationProviding {
|
|||
)
|
||||
cfg.username = parameters.username
|
||||
cfg.shouldDebug = true
|
||||
cfg.debugLogPath = parameters.preferences.tunnelLogPath
|
||||
if let filename = parameters.preferences.tunnelLogPath {
|
||||
cfg.debugLogPath = vpnPath(with: filename)
|
||||
}
|
||||
cfg.debugLogFormat = parameters.preferences.tunnelLogFormat
|
||||
cfg.masksPrivateData = parameters.preferences.masksPrivateData
|
||||
|
||||
|
|
|
@ -63,3 +63,11 @@ extension VPNProtocolType {
|
|||
true
|
||||
}
|
||||
}
|
||||
|
||||
extension VPNProtocolProviding {
|
||||
func vpnPath(with path: String) -> String {
|
||||
var components = path.split(separator: "/").map(String.init)
|
||||
components.insert(vpnProtocol.description, at: components.count - 1)
|
||||
return components.joined(separator: "/")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,9 @@ extension Profile.WireGuardSettings: VPNConfigurationProviding {
|
|||
configuration: customConfiguration
|
||||
)
|
||||
cfg.shouldDebug = true
|
||||
cfg.debugLogPath = parameters.preferences.tunnelLogPath
|
||||
if let filename = parameters.preferences.tunnelLogPath {
|
||||
cfg.debugLogPath = vpnPath(with: filename)
|
||||
}
|
||||
cfg.debugLogFormat = parameters.preferences.tunnelLogFormat
|
||||
|
||||
var extra = NetworkExtensionExtra()
|
||||
|
|
Loading…
Reference in New Issue