From f1efac073cdd3fd921079222742cd78131f9b88e Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Wed, 24 Oct 2018 19:28:15 +0200 Subject: [PATCH] Export and document log shortcuts in Configuration --- .../TunnelKitProvider+Configuration.swift | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/TunnelKit/Sources/AppExtension/TunnelKitProvider+Configuration.swift b/TunnelKit/Sources/AppExtension/TunnelKitProvider+Configuration.swift index 1489e38..6656453 100644 --- a/TunnelKit/Sources/AppExtension/TunnelKitProvider+Configuration.swift +++ b/TunnelKit/Sources/AppExtension/TunnelKitProvider+Configuration.swift @@ -404,7 +404,13 @@ extension TunnelKitProvider { // MARK: Shortcuts - func urlForLog(in appGroup: String) -> URL? { + /** + Returns the URL of the latest debug log. + + - Parameter in: The app group where to locate the log file. + - Returns: The URL of the debug log, if any. + */ + public func urlForLog(in appGroup: String) -> URL? { guard shouldDebug, let key = debugLogKey else { return nil } @@ -414,7 +420,13 @@ extension TunnelKitProvider { return parentURL.appendingPathComponent("\(key).log") } - func existingLog(in appGroup: String) -> String? { + /** + Returns the content of the latest debug log. + + - Parameter in: The app group where to locate the log file. + - Returns: The content of the debug log, if any. + */ + public func existingLog(in appGroup: String) -> String? { guard let url = urlForLog(in: appGroup) else { return nil }