diff --git a/Mastodon.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Mastodon.xcworkspace/xcshareddata/swiftpm/Package.resolved index f222992f7..e89928123 100644 --- a/Mastodon.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Mastodon.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -19,15 +19,6 @@ "version": "4.2.0" } }, - { - "package": "CommonOSLog", - "repositoryURL": "https://github.com/MainasuK/CommonOSLog", - "state": { - "branch": null, - "revision": "c121624a30698e9886efe38aebb36ff51c01b6c2", - "version": "0.1.1" - } - }, { "package": "FaviconFinder", "repositoryURL": "https://github.com/will-lumley/FaviconFinder.git", diff --git a/Mastodon/Scene/Search/SearchDetail/SearchHistory/SearchHistoryViewModel.swift b/Mastodon/Scene/Search/SearchDetail/SearchHistory/SearchHistoryViewModel.swift index 5078895c0..d1360efc4 100644 --- a/Mastodon/Scene/Search/SearchDetail/SearchHistory/SearchHistoryViewModel.swift +++ b/Mastodon/Scene/Search/SearchDetail/SearchHistory/SearchHistoryViewModel.swift @@ -8,7 +8,6 @@ import UIKit import Combine import CoreDataStack -import CommonOSLog import MastodonCore final class SearchHistoryViewModel { diff --git a/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel.swift b/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel.swift index f66921535..c3ddc2f0a 100644 --- a/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel.swift +++ b/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel.swift @@ -10,7 +10,6 @@ import Combine import CoreData import CoreDataStack import GameplayKit -import CommonOSLog import MastodonSDK import MastodonCore diff --git a/MastodonSDK/Package.swift b/MastodonSDK/Package.swift index 12aadd888..75990451c 100644 --- a/MastodonSDK/Package.swift +++ b/MastodonSDK/Package.swift @@ -46,7 +46,6 @@ let package = Package( .package(url: "https://github.com/kean/Nuke-FLAnimatedImage-Plugin.git", from: "8.0.0"), .package(url: "https://github.com/kean/Nuke.git", from: "10.3.1"), .package(url: "https://github.com/kishikawakatsumi/KeychainAccess.git", from: "4.2.2"), - .package(url: "https://github.com/MainasuK/CommonOSLog", from: "0.1.1"), .package(url: "https://github.com/MainasuK/FPSIndicator.git", from: "1.0.0"), .package(url: "https://github.com/slackhq/PanModal.git", from: "1.2.7"), .package(url: "https://github.com/TimOliver/TOCropViewController.git", from: "2.6.1"), @@ -93,7 +92,6 @@ let package = Package( "MastodonSDK", .product(name: "Alamofire", package: "Alamofire"), .product(name: "AlamofireImage", package: "AlamofireImage"), - .product(name: "CommonOSLog", package: "CommonOSLog"), .product(name: "ArkanaKeys", package: "ArkanaKeys"), .product(name: "KeychainAccess", package: "KeychainAccess"), .product(name: "MetaTextKit", package: "MetaTextKit") diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Account.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Account.swift index 812c558d8..c1642218c 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Account.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Account.swift @@ -9,7 +9,6 @@ import os.log import CoreDataStack import Foundation import Combine -import CommonOSLog import MastodonCommon import MastodonSDK @@ -49,8 +48,6 @@ extension APIService { ) let flag = result.isNewInsertion ? "+" : "-" - let logger = Logger(subsystem: "APIService", category: "AccountInfo") - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): fetch mastodon user [\(flag)](\(response.value.id))\(response.value.username)") } return response diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Block.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Block.swift index 19c5ff437..2dafe4676 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Block.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Block.swift @@ -9,7 +9,6 @@ import UIKit import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { @@ -65,7 +64,6 @@ extension APIService { user: ManagedObjectRecord, authenticationBox: MastodonAuthenticationBox ) async throws -> Mastodon.Response.Content { - let logger = Logger(subsystem: "APIService", category: "Block") let managedObjectContext = backgroundManagedObjectContext let blockContext: MastodonBlockContext = try await managedObjectContext.performChanges { @@ -84,7 +82,7 @@ extension APIService { // will do block action. set to unfollow user.update(isFollowing: false, by: me) } - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Local] update user[\(user.id)](\(user.username)) block state: \(!isBlocking)") + return MastodonBlockContext( sourceUserID: me.id, targetUserID: user.id, @@ -115,7 +113,6 @@ extension APIService { } } catch { result = .failure(error) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Remote] update user[\(blockContext.targetUserID)](\(blockContext.targetUsername)) block failure: \(error.localizedDescription)") } try await managedObjectContext.performChanges { @@ -135,12 +132,10 @@ extension APIService { networkDate: response.networkDate ) ) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Remote] update user[\(blockContext.targetUserID)](\(blockContext.targetUsername)) block state: \(relationship.blocking)") case .failure: // rollback user.update(isBlocking: blockContext.isBlocking, by: me) user.update(isFollowing: blockContext.isFollowing, by: me) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Remote] rollback user[\(blockContext.targetUserID)](\(blockContext.targetUsername)) block state") } } diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Bookmark.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Bookmark.swift index 0d8c243f8..43a050ea2 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Bookmark.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Bookmark.swift @@ -10,7 +10,6 @@ import Combine import MastodonSDK import CoreData import CoreDataStack -import CommonOSLog extension APIService { @@ -23,8 +22,7 @@ extension APIService { record: ManagedObjectRecord, authenticationBox: MastodonAuthenticationBox ) async throws -> Mastodon.Response.Content { - let logger = Logger(subsystem: "APIService", category: "Bookmark") - + let managedObjectContext = backgroundManagedObjectContext // update bookmark state and retrieve bookmark context @@ -42,7 +40,6 @@ extension APIService { statusID: status.id, isBookmarked: isBookmarked ) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): update status bookmark: \(!isBookmarked)") return context } @@ -59,7 +56,6 @@ extension APIService { result = .success(response) } catch { result = .failure(error) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): update bookmark failure: \(error.localizedDescription)") } // update bookmark state @@ -83,11 +79,9 @@ extension APIService { networkDate: response.networkDate ) ) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): update status bookmark: \(response.value.bookmarked.debugDescription)") case .failure: // rollback status.update(bookmarked: bookmarkContext.isBookmarked, by: me) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): rollback status bookmark") } } diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+CustomEmoji.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+CustomEmoji.swift index 647bb4956..2586da81a 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+CustomEmoji.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+CustomEmoji.swift @@ -9,7 +9,6 @@ import Foundation import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+DomainBlock.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+DomainBlock.swift index 138997500..3bfa519c7 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+DomainBlock.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+DomainBlock.swift @@ -6,7 +6,6 @@ // import Combine -import CommonOSLog import CoreData import CoreDataStack import Foundation diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Favorite.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Favorite.swift index 4abe9ba5f..eaa87d15e 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Favorite.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Favorite.swift @@ -11,7 +11,6 @@ import Combine import MastodonSDK import CoreData import CoreDataStack -import CommonOSLog extension APIService { @@ -25,8 +24,7 @@ extension APIService { record: ManagedObjectRecord, authenticationBox: MastodonAuthenticationBox ) async throws -> Mastodon.Response.Content { - let logger = Logger(subsystem: "APIService", category: "Favorite") - + let managedObjectContext = backgroundManagedObjectContext // update like state and retrieve like context @@ -48,7 +46,6 @@ extension APIService { isFavorited: isFavorited, favoritedCount: favoritedCount ) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): update status favorite: \(!isFavorited), \(favoriteCount)") return context } @@ -65,7 +62,6 @@ extension APIService { result = .success(response) } catch { result = .failure(error) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): update favorite failure: \(error.localizedDescription)") } // update like state @@ -92,12 +88,10 @@ extension APIService { if favoriteContext.isFavorited { status.update(favouritesCount: max(0, status.favouritesCount - 1)) // undo API return count has delay. Needs -1 local } - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): update status favorite: \(response.value.favourited.debugDescription)") case .failure: // rollback status.update(liked: favoriteContext.isFavorited, by: me) status.update(favouritesCount: favoriteContext.favoritedCount) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): rollback status favorite") } } diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Follow.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Follow.swift index 442d293ce..75ed5ba38 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Follow.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Follow.swift @@ -9,7 +9,6 @@ import UIKit import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { @@ -34,8 +33,7 @@ extension APIService { user: ManagedObjectRecord, authenticationBox: MastodonAuthenticationBox ) async throws -> Mastodon.Response.Content { - let logger = Logger(subsystem: "APIService", category: "Follow") - + let managedObjectContext = backgroundManagedObjectContext let _followContext: MastodonFollowContext? = try await managedObjectContext.performChanges { guard let me = authenticationBox.authenticationRecord.object(in: managedObjectContext)?.user else { return nil } @@ -49,17 +47,14 @@ extension APIService { // unfollow user.update(isFollowing: false, by: me) user.update(isFollowRequested: false, by: me) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Local] update user friendship: undo follow") } else { // follow if user.locked { user.update(isFollowing: false, by: me) user.update(isFollowRequested: true, by: me) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Local] update user friendship: pending follow") } else { user.update(isFollowing: true, by: me) user.update(isFollowRequested: false, by: me) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Local] update user friendship: following") } } let context = MastodonFollowContext( @@ -88,7 +83,6 @@ extension APIService { ).singleOutput() result = .success(response) } catch { - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Remote] update friendship failure: \(error.localizedDescription)") result = .failure(error) } @@ -109,12 +103,10 @@ extension APIService { ) ) let following = response.value.following - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Remote] update user friendship: following \(following)") case .failure: // rollback user.update(isFollowing: followContext.isFollowing, by: me) user.update(isFollowRequested: followContext.isPending, by: me) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Remote] rollback user friendship") } } diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+FollowRequest.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+FollowRequest.swift index 74650131d..e5e330c0f 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+FollowRequest.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+FollowRequest.swift @@ -9,7 +9,6 @@ import UIKit import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Follower.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Follower.swift index 0f0ea1a59..05670604d 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Follower.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Follower.swift @@ -9,7 +9,6 @@ import UIKit import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Following.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Following.swift index 313d715ed..b6a01998f 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Following.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Following.swift @@ -9,7 +9,6 @@ import UIKit import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HashtagTimeline.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HashtagTimeline.swift index d2fbe844a..91c2f8201 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HashtagTimeline.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HashtagTimeline.swift @@ -9,7 +9,6 @@ import Foundation import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift index dad844d37..97bd53469 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift @@ -9,7 +9,6 @@ import Foundation import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Instance.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Instance.swift index eb39b5585..b5a549903 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Instance.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Instance.swift @@ -9,7 +9,6 @@ import Foundation import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Mute.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Mute.swift index cc46872f4..7b6b6c6c3 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Mute.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Mute.swift @@ -9,7 +9,6 @@ import UIKit import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { @@ -64,8 +63,7 @@ extension APIService { user: ManagedObjectRecord, authenticationBox: MastodonAuthenticationBox ) async throws -> Mastodon.Response.Content { - let logger = Logger(subsystem: "APIService", category: "Mute") - + let managedObjectContext = backgroundManagedObjectContext let muteContext: MastodonMuteContext = try await managedObjectContext.performChanges { guard let user = user.object(in: managedObjectContext), @@ -79,7 +77,6 @@ extension APIService { // toggle mute state user.update(isMuting: !isMuting, by: me) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Local] update user[\(user.id)](\(user.username)) mute state: \(!isMuting)") return MastodonMuteContext( sourceUserID: me.id, targetUserID: user.id, @@ -111,7 +108,6 @@ extension APIService { } } catch { result = .failure(error) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Remote] update user[\(muteContext.targetUserID)](\(muteContext.targetUsername)) mute failure: \(error.localizedDescription)") } try await managedObjectContext.performChanges { @@ -131,11 +127,9 @@ extension APIService { networkDate: response.networkDate ) ) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Remote] update user[\(muteContext.targetUserID)](\(muteContext.targetUsername)) mute state: \(relationship.muting.debugDescription)") case .failure: // rollback user.update(isMuting: muteContext.isMuting, by: me) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [Remote] rollback user[\(muteContext.targetUserID)](\(muteContext.targetUsername)) mute state") } } diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Poll.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Poll.swift index 5a4b38b29..505a06032 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Poll.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Poll.swift @@ -9,7 +9,6 @@ import Foundation import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+PublicTimeline.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+PublicTimeline.swift index 21f198299..0636f70c4 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+PublicTimeline.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+PublicTimeline.swift @@ -9,7 +9,6 @@ import Foundation import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Reblog.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Reblog.swift index 0dc1a40e5..73b77fa3c 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Reblog.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Reblog.swift @@ -10,7 +10,6 @@ import Combine import MastodonSDK import CoreData import CoreDataStack -import CommonOSLog extension APIService { @@ -24,7 +23,6 @@ extension APIService { record: ManagedObjectRecord, authenticationBox: MastodonAuthenticationBox ) async throws -> Mastodon.Response.Content { - let logger = Logger(subsystem: "APIService", category: "Reblog") let managedObjectContext = backgroundManagedObjectContext // update repost state and retrieve repost context @@ -45,7 +43,6 @@ extension APIService { isReblogged: isReblogged, rebloggedCount: rebloggedCount ) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): update status reblog: \(!isReblogged), \(reblogCount)") return reblogContext } guard let reblogContext = _reblogContext else { @@ -65,7 +62,6 @@ extension APIService { result = .success(response) } catch { result = .failure(error) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): update reblog failure: \(error.localizedDescription)") } // update repost state @@ -92,12 +88,10 @@ extension APIService { if reblogContext.isReblogged { status.update(reblogsCount: max(0, status.reblogsCount - 1)) // undo API return count has delay. Needs -1 local } - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): update status reblog: \(!reblogContext.isReblogged)") case .failure: // rollback status.update(reblogged: reblogContext.isReblogged, by: me) status.update(reblogsCount: reblogContext.rebloggedCount) - logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): rollback status reblog") } } diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Relationship.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Relationship.swift index f5c108725..7cbd63ca6 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Relationship.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Relationship.swift @@ -9,7 +9,6 @@ import UIKit import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Search.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Search.swift index 5e6217bcf..e1ef7b0f5 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Search.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Search.swift @@ -8,7 +8,6 @@ import Foundation import Combine import MastodonSDK -import CommonOSLog extension APIService { diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Status+Translate.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Status+Translate.swift index a802d6489..483f52431 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Status+Translate.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Status+Translate.swift @@ -9,7 +9,6 @@ import Foundation import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Status.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Status.swift index 52b169ee7..05ce66792 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Status.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Status.swift @@ -9,7 +9,6 @@ import Foundation import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+UserTimeline.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+UserTimeline.swift index fdf90a2aa..b0ee77f26 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+UserTimeline.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+UserTimeline.swift @@ -9,7 +9,6 @@ import Foundation import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+WebFinger.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+WebFinger.swift index b542cbe8d..26d86edf4 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+WebFinger.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+WebFinger.swift @@ -9,7 +9,6 @@ import Foundation import Combine import CoreData import CoreDataStack -import CommonOSLog import MastodonSDK extension APIService { diff --git a/NotificationService/NotificationService.swift b/NotificationService/NotificationService.swift index d38884aff..a17cbfd2a 100644 --- a/NotificationService/NotificationService.swift +++ b/NotificationService/NotificationService.swift @@ -6,7 +6,6 @@ // import UserNotifications -import CommonOSLog import CryptoKit import AlamofireImage import MastodonCore @@ -22,13 +21,11 @@ class NotificationService: UNNotificationServiceExtension { if let bestAttemptContent = bestAttemptContent { // Modify the notification content here... - os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function) let privateKey = AppSecret.default.notificationPrivateKey let auth = AppSecret.default.notificationAuth guard let encodedPayload = bestAttemptContent.userInfo["p"] as? String else { - os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s: invalid payload", ((#file as NSString).lastPathComponent), #line, #function) contentHandler(bestAttemptContent) return } @@ -36,13 +33,11 @@ class NotificationService: UNNotificationServiceExtension { guard let encodedPublicKey = bestAttemptContent.userInfo["k"] as? String, let publicKey = NotificationService.publicKey(encodedPublicKey: encodedPublicKey) else { - os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s: invalid public key", ((#file as NSString).lastPathComponent), #line, #function) contentHandler(bestAttemptContent) return } guard let encodedSalt = bestAttemptContent.userInfo["s"] as? String else { - os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s: invalid salt", ((#file as NSString).lastPathComponent), #line, #function) contentHandler(bestAttemptContent) return } @@ -75,10 +70,9 @@ class NotificationService: UNNotificationServiceExtension { ImageDownloader.default.download(URLRequest(url: url), completion: { [weak self] response in guard let _ = self else { return } switch response.result { - case .failure(let error): - os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s: download image %s fail: %s", ((#file as NSString).lastPathComponent), #line, #function, url.debugDescription, error.localizedDescription) + case .failure(_): + break case .success(let image): - os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s: download image %s success", ((#file as NSString).lastPathComponent), #line, #function, url.debugDescription) try? image.pngData()?.write(to: fileURL) if let attachment = try? UNNotificationAttachment(identifier: filename, url: fileURL, options: nil) { bestAttemptContent.attachments = [attachment]