Skip to content

Commit

Permalink
Merge pull request #8 from GoodRequest/fix/public-loggers
Browse files Browse the repository at this point in the history
fix: Make Loggers Public
  • Loading branch information
andrej-jasso authored Jan 30, 2024
2 parents 3c0b734 + c715a6c commit 5d6c329
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// OSLogSessionLogger.swift
// OSLogLogger.swift
//
//
// Created by Matus Klasovity on 30/01/2024.
Expand All @@ -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)")
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/GoodNetworking/Session/Logger/PrintLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}
Expand Down

0 comments on commit 5d6c329

Please sign in to comment.