From c715a6cee636d5f2fb9ea658add935a85ad798c4 Mon Sep 17 00:00:00 2001 From: Matus Klasovity Date: Tue, 30 Jan 2024 15:41:19 +0100 Subject: [PATCH] fix: Make Loggers Public --- .../GoodNetworking/Session/Logger/LoggingEventMonitor.swift | 2 +- .../Logger/{OSLogSessionLogger.swift => OSLogLogger.swift} | 6 +++--- Sources/GoodNetworking/Session/Logger/PrintLogger.swift | 4 ++-- .../Session/NetworkSessionConfiguration.swift | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename Sources/GoodNetworking/Session/Logger/{OSLogSessionLogger.swift => OSLogLogger.swift} (67%) diff --git a/Sources/GoodNetworking/Session/Logger/LoggingEventMonitor.swift b/Sources/GoodNetworking/Session/Logger/LoggingEventMonitor.swift index 1e96e67..0ec17bb 100644 --- a/Sources/GoodNetworking/Session/Logger/LoggingEventMonitor.swift +++ b/Sources/GoodNetworking/Session/Logger/LoggingEventMonitor.swift @@ -8,7 +8,7 @@ import Foundation import Alamofire -open class LoggingEventMonitor: EventMonitor { +public class LoggingEventMonitor: EventMonitor { public let queue = DispatchQueue(label: C.queueLabel, qos: .background) diff --git a/Sources/GoodNetworking/Session/Logger/OSLogSessionLogger.swift b/Sources/GoodNetworking/Session/Logger/OSLogLogger.swift similarity index 67% rename from Sources/GoodNetworking/Session/Logger/OSLogSessionLogger.swift rename to Sources/GoodNetworking/Session/Logger/OSLogLogger.swift index b91d3bd..8521fac 100644 --- a/Sources/GoodNetworking/Session/Logger/OSLogSessionLogger.swift +++ b/Sources/GoodNetworking/Session/Logger/OSLogLogger.swift @@ -1,5 +1,5 @@ // -// OSLogSessionLogger.swift +// OSLogLogger.swift // // // Created by Matus Klasovity on 30/01/2024. @@ -9,11 +9,11 @@ import Foundation import OSLog @available(iOS 14, *) -final class OSLogSessionLogger: SessionLogger { +public final class OSLogLogger: SessionLogger { private let logger = Logger(subsystem: "OSLogSessionLogger", category: "Networking") - func log(level: OSLogType, message: String) { + public func log(level: OSLogType, message: String) { logger.log(level: level, "\(message)") } diff --git a/Sources/GoodNetworking/Session/Logger/PrintLogger.swift b/Sources/GoodNetworking/Session/Logger/PrintLogger.swift index 8cf38b5..418f486 100644 --- a/Sources/GoodNetworking/Session/Logger/PrintLogger.swift +++ b/Sources/GoodNetworking/Session/Logger/PrintLogger.swift @@ -8,9 +8,9 @@ import Foundation import OSLog -final class PrintLogger: SessionLogger { +public final class PrintLogger: SessionLogger { - func log(level: OSLogType, message: String) { + public func log(level: OSLogType, message: String) { print(message) } diff --git a/Sources/GoodNetworking/Session/NetworkSessionConfiguration.swift b/Sources/GoodNetworking/Session/NetworkSessionConfiguration.swift index 1b6795f..a9bab17 100644 --- a/Sources/GoodNetworking/Session/NetworkSessionConfiguration.swift +++ b/Sources/GoodNetworking/Session/NetworkSessionConfiguration.swift @@ -53,7 +53,7 @@ public final class NetworkSessionConfiguration { var eventMonitors: [EventMonitor] = [] if #available(iOS 14, *) { - eventMonitors.append(LoggingEventMonitor(logger: OSLogSessionLogger())) + eventMonitors.append(LoggingEventMonitor(logger: OSLogLogger())) } else { eventMonitors.append(LoggingEventMonitor(logger: PrintLogger())) }