diff --git a/Sources/TunnelKitOpenVPNAppExtension/OpenVPNTunnelProvider.swift b/Sources/TunnelKitOpenVPNAppExtension/OpenVPNTunnelProvider.swift index 79aa4db..e820fe7 100644 --- a/Sources/TunnelKitOpenVPNAppExtension/OpenVPNTunnelProvider.swift +++ b/Sources/TunnelKitOpenVPNAppExtension/OpenVPNTunnelProvider.swift @@ -813,7 +813,7 @@ extension OpenVPNTunnelProvider { // MARK: Logging - private func configureLogging(debug: Bool, customFormat: String? = nil) { + private func configureLogging(debug: Bool, customFormat: String?) { let logLevel: SwiftyBeaver.Level = (debug ? debugLogLevel : .info) let logFormat = customFormat ?? "$Dyyyy-MM-dd HH:mm:ss.SSS$d $L $N.$F:$l - $M" diff --git a/Sources/TunnelKitWireGuardAppExtension/WireGuardTunnelProvider.swift b/Sources/TunnelKitWireGuardAppExtension/WireGuardTunnelProvider.swift index 5820d27..7c00a26 100644 --- a/Sources/TunnelKitWireGuardAppExtension/WireGuardTunnelProvider.swift +++ b/Sources/TunnelKitWireGuardAppExtension/WireGuardTunnelProvider.swift @@ -40,7 +40,7 @@ open class WireGuardTunnelProvider: NEPacketTunnelProvider { return } - configureLogging(debug: cfg.shouldDebug) + configureLogging(debug: cfg.shouldDebug, customFormat: cfg.debugLogFormat) // END: TunnelKit @@ -125,7 +125,7 @@ open class WireGuardTunnelProvider: NEPacketTunnelProvider { } extension WireGuardTunnelProvider { - private func configureLogging(debug: Bool, customFormat: String? = nil) { + private func configureLogging(debug: Bool, customFormat: String?) { let logLevel: SwiftyBeaver.Level = (debug ? .debug : .info) let logFormat = customFormat ?? "$Dyyyy-MM-dd HH:mm:ss.SSS$d $L $N.$F:$l - $M" diff --git a/Sources/TunnelKitWireGuardManager/WireGuard+ProviderConfiguration.swift b/Sources/TunnelKitWireGuardManager/WireGuard+ProviderConfiguration.swift index ec51b8c..dcd18fb 100644 --- a/Sources/TunnelKitWireGuardManager/WireGuard+ProviderConfiguration.swift +++ b/Sources/TunnelKitWireGuardManager/WireGuard+ProviderConfiguration.swift @@ -53,6 +53,8 @@ extension WireGuard { public var shouldDebug = false + public var debugLogFormat: String? = nil + public init(_ title: String, appGroup: String, configuration: WireGuard.Configuration) { self.title = title self.appGroup = appGroup