Skip to content

Commit

Permalink
Merge pull request #9 from GoodRequest/feature/good_logger
Browse files Browse the repository at this point in the history
feat: added goodLogger dependency
  • Loading branch information
matusklasovity authored Jun 12, 2024
2 parents f2f8c74 + ced403c commit fc8301e
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
"version" : "1.8.1"
}
},
{
"identity" : "goodlogger",
"kind" : "remoteSourceControl",
"location" : "https://github.com/GoodRequest/GoodLogger.git",
"state" : {
"revision" : "7e0a11ffa920889c8d289c1dca60d6b0c94b0ae9",
"version" : "1.0.0"
}
},
{
"identity" : "keychainaccess",
"kind" : "remoteSourceControl",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit
import GoodPersistence
import GoodLogger

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand Down
9 changes: 9 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
"version" : "1.8.1"
}
},
{
"identity" : "goodlogger",
"kind" : "remoteSourceControl",
"location" : "https://github.com/GoodRequest/GoodLogger.git",
"state" : {
"revision" : "7e0a11ffa920889c8d289c1dca60d6b0c94b0ae9",
"version" : "1.0.0"
}
},
{
"identity" : "keychainaccess",
"kind" : "remoteSourceControl",
Expand Down
6 changes: 4 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ let package = Package(
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/CombineCommunity/CombineExt.git", from: "1.0.0"),
.package(url: "https://github.com/kishikawakatsumi/KeychainAccess.git", from: "4.2.2")
.package(url: "https://github.com/kishikawakatsumi/KeychainAccess.git", from: "4.2.2"),
.package(url: "https://github.com/GoodRequest/GoodLogger.git", from: "1.0.0")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand All @@ -26,7 +27,8 @@ let package = Package(
name: "GoodPersistence",
dependencies: [
.product(name: "CombineExt", package: "CombineExt"),
.product(name: "KeychainAccess", package: "KeychainAccess")
.product(name: "KeychainAccess", package: "KeychainAccess"),
.product(name: "GoodLogger", package: "GoodLogger")
],
path: "./Sources",
resources: [.copy("PrivacyInfo.xcprivacy")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@
//

import Foundation
import GoodLogger

public final class LoggingPersistenceMonitor: PersistenceMonitor {

private var logger: (any PersistanceLogger)?
private var logger: (any GoodLogger)?

public init(logger: (any PersistanceLogger)?) {
public init(logger: (any GoodLogger)?) {
self.logger = logger
}

public func didReceive(_ monitor: any PersistenceMonitor, error: any Error) {
logger?.log(level: .error, message: error.localizedDescription)
logger?.log(level: .error, message: error.localizedDescription, privacy: .auto)
}

public func didReceive(_ monitor: any PersistenceMonitor, message: String) {
logger?.log(level: .info, message: message)
logger?.log(level: .info, message: message, privacy: .auto)
}

}
21 changes: 0 additions & 21 deletions Sources/GoodPersistence/LoggingMonitor/OSLogger.swift

This file was deleted.

14 changes: 0 additions & 14 deletions Sources/GoodPersistence/LoggingMonitor/PersistenceLogger.swift

This file was deleted.

18 changes: 0 additions & 18 deletions Sources/GoodPersistence/LoggingMonitor/PrintLogger.swift

This file was deleted.

0 comments on commit fc8301e

Please sign in to comment.