diff --git a/Sources/TunnelKitOpenVPNAppExtension/OpenVPNTunnelProvider.swift b/Sources/TunnelKitOpenVPNAppExtension/OpenVPNTunnelProvider.swift index a035f5b..f441c2c 100644 --- a/Sources/TunnelKitOpenVPNAppExtension/OpenVPNTunnelProvider.swift +++ b/Sources/TunnelKitOpenVPNAppExtension/OpenVPNTunnelProvider.swift @@ -173,10 +173,7 @@ open class OpenVPNTunnelProvider: NEPacketTunnelProvider { } // prepare for logging (append) - configureLogging( - debug: cfg.shouldDebug, - customFormat: cfg.debugLogFormat - ) + configureLogging() // logging only ACTIVE from now on log.info("") @@ -814,11 +811,11 @@ extension OpenVPNTunnelProvider { // MARK: Logging - 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" + private func configureLogging() { + let logLevel: SwiftyBeaver.Level = (cfg.shouldDebug ? debugLogLevel : .info) + let logFormat = cfg.debugLogFormat ?? "$Dyyyy-MM-dd HH:mm:ss.SSS$d $L $N.$F:$l - $M" - if debug { + if cfg.shouldDebug { let console = ConsoleDestination() console.useNSLog = true console.minLevel = logLevel diff --git a/Sources/TunnelKitWireGuardAppExtension/WireGuardTunnelProvider.swift b/Sources/TunnelKitWireGuardAppExtension/WireGuardTunnelProvider.swift index 7c00a26..921d4b4 100644 --- a/Sources/TunnelKitWireGuardAppExtension/WireGuardTunnelProvider.swift +++ b/Sources/TunnelKitWireGuardAppExtension/WireGuardTunnelProvider.swift @@ -40,7 +40,7 @@ open class WireGuardTunnelProvider: NEPacketTunnelProvider { return } - configureLogging(debug: cfg.shouldDebug, customFormat: cfg.debugLogFormat) + configureLogging() // END: TunnelKit @@ -125,11 +125,11 @@ open class WireGuardTunnelProvider: NEPacketTunnelProvider { } extension WireGuardTunnelProvider { - 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" + private func configureLogging() { + let logLevel: SwiftyBeaver.Level = (cfg.shouldDebug ? .debug : .info) + let logFormat = cfg.debugLogFormat ?? "$Dyyyy-MM-dd HH:mm:ss.SSS$d $L $N.$F:$l - $M" - if debug { + if cfg.shouldDebug { let console = ConsoleDestination() console.useNSLog = true console.minLevel = logLevel