diff --git a/Core/ContentBlocking.swift b/Core/ContentBlocking.swift index 48f172831b..b63e7ca23b 100644 --- a/Core/ContentBlocking.swift +++ b/Core/ContentBlocking.swift @@ -69,8 +69,7 @@ public final class ContentBlocking { contentBlockingManager = ContentBlockerRulesManager(rulesSource: contentBlockerRulesSource, exceptionsSource: exceptionsSource, lastCompiledRulesStore: lastCompiledRulesStore, - errorReporting: Self.debugEvents, - log: .contentBlockingLog) + errorReporting: Self.debugEvents) adClickAttributionRulesProvider = AdClickAttributionRulesProvider(config: adClickAttribution, compiledRulesSource: contentBlockingManager, diff --git a/Core/Logging.swift b/Core/Logging.swift index 9be20c9153..ad8057f979 100644 --- a/Core/Logging.swift +++ b/Core/Logging.swift @@ -21,11 +21,11 @@ import Foundation import BrowserServicesKit import Common + public extension OSLog { enum AppCategories: String, CaseIterable { case generalLog = "DDG General" - case contentBlockingLog = "DDG Content Blocking" case adAttributionLog = "DDG AdAttribution" case lifecycleLog = "DDG Lifecycle" case autoconsentLog = "DDG Autoconsent" @@ -35,7 +35,6 @@ public extension OSLog { } @OSLogWrapper(.generalLog) static var generalLog - @OSLogWrapper(.contentBlockingLog) static var contentBlockingLog @OSLogWrapper(.adAttributionLog) static var adAttributionLog @OSLogWrapper(.lifecycleLog) static var lifecycleLog @OSLogWrapper(.autoconsentLog) static var autoconsentLog @@ -48,7 +47,6 @@ public extension OSLog { #if DEBUG static var enabledCategories: Set = [ .generalLog, - .contentBlockingLog, .adAttributionLog, .lifecycleLog, .configurationLog, diff --git a/Core/SyncCredentialsAdapter.swift b/Core/SyncCredentialsAdapter.swift index 39443a1296..7fa4b8c509 100644 --- a/Core/SyncCredentialsAdapter.swift +++ b/Core/SyncCredentialsAdapter.swift @@ -43,8 +43,7 @@ public final class SyncCredentialsAdapter { databaseCleaner = CredentialsDatabaseCleaner( secureVaultFactory: secureVaultFactory, secureVaultErrorReporter: secureVaultErrorReporter, - errorEvents: CredentialsCleanupErrorHandling(), - log: .generalLog + errorEvents: CredentialsCleanupErrorHandling() ) } diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 80499e8b71..9fb06fa79d 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -997,7 +997,6 @@ F115ED9C2B4EFC8E001A0453 /* TestUtils in Frameworks */ = {isa = PBXBuildFile; productRef = F115ED9B2B4EFC8E001A0453 /* TestUtils */; }; F130D73A1E5776C500C45811 /* OmniBarDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F130D7391E5776C500C45811 /* OmniBarDelegate.swift */; }; F132D6A52C62239B00D85426 /* SubscriptionSettingsHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F132D6A42C62239B00D85426 /* SubscriptionSettingsHeaderView.swift */; }; - F132D6A82C6524B600D85426 /* Logger+Subscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = F132D6A72C6524B600D85426 /* Logger+Subscription.swift */; }; F1386BA41E6846C40062FC3C /* TabDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1386BA31E6846C40062FC3C /* TabDelegate.swift */; }; F13B4BC01F180D8A00814661 /* TabsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F13B4BBF1F180D8A00814661 /* TabsModel.swift */; }; F13B4BD31F1822C700814661 /* Tab.swift in Sources */ = {isa = PBXBuildFile; fileRef = F13B4BD21F1822C700814661 /* Tab.swift */; }; @@ -2777,7 +2776,6 @@ F114C55A1E66EB020018F95F /* NibLoading.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NibLoading.swift; sourceTree = ""; }; F130D7391E5776C500C45811 /* OmniBarDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OmniBarDelegate.swift; sourceTree = ""; }; F132D6A42C62239B00D85426 /* SubscriptionSettingsHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionSettingsHeaderView.swift; sourceTree = ""; }; - F132D6A72C6524B600D85426 /* Logger+Subscription.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Logger+Subscription.swift"; sourceTree = ""; }; F1386BA31E6846C40062FC3C /* TabDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabDelegate.swift; sourceTree = ""; }; F13B4BBF1F180D8A00814661 /* TabsModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabsModel.swift; sourceTree = ""; }; F13B4BD21F1822C700814661 /* Tab.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tab.swift; sourceTree = ""; }; @@ -5045,7 +5043,6 @@ isa = PBXGroup; children = ( F1FDC9342BF51E41006B1435 /* VPNSettings+Environment.swift */, - F132D6A72C6524B600D85426 /* Logger+Subscription.swift */, D664C7982B289AA000CBFA76 /* WKUserContentController+Handler.swift */, ); path = Extensions; @@ -7325,7 +7322,6 @@ 85C861E628FF1B5F00189466 /* HomeViewSectionRenderersExtension.swift in Sources */, CB825C922C071B1400BCC586 /* AlertView.swift in Sources */, 1DDF40292BA04FCD006850D9 /* SettingsPrivacyProtectionsView.swift in Sources */, - F132D6A82C6524B600D85426 /* Logger+Subscription.swift in Sources */, 6F64AA5F2C49463C00CF4489 /* ShortcutsModel.swift in Sources */, F1D477C61F2126CC0031ED49 /* OmniBarState.swift in Sources */, 85F2FFCD2211F615006BB258 /* MainViewController+KeyCommands.swift in Sources */, @@ -10543,7 +10539,7 @@ repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 184.0.1; + version = 185.0.0; }; }; 9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index d3884d9834..b43be26e96 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/DuckDuckGo/BrowserServicesKit", "state" : { - "revision" : "b7f595594d9e5d8500a93704d36a5521553bd314", - "version" : "184.0.1" + "revision" : "2efee14db4d30ac73916794de4d262b745a5f413", + "version" : "185.0.0" } }, { diff --git a/DuckDuckGo/Configuration/ConfigurationManager.swift b/DuckDuckGo/Configuration/ConfigurationManager.swift index f0a148adcd..099facddaa 100644 --- a/DuckDuckGo/Configuration/ConfigurationManager.swift +++ b/DuckDuckGo/Configuration/ConfigurationManager.swift @@ -50,7 +50,7 @@ struct ConfigurationManager { } public static let didUpdateTrackerDependencies = NSNotification.Name(rawValue: "com.duckduckgo.configurationManager.didUpdateTrackerDependencies") - private let fetcher = ConfigurationFetcher(store: ConfigurationStore.shared, log: .configurationLog, eventMapping: Self.configurationDebugEvents) + private let fetcher = ConfigurationFetcher(store: ConfigurationStore.shared, eventMapping: Self.configurationDebugEvents) private static let configurationDebugEvents = EventMapping { event, error, _, _ in let domainEvent: Pixel.Event diff --git a/DuckDuckGo/HomePageConfiguration.swift b/DuckDuckGo/HomePageConfiguration.swift index 8ddbd84440..bdec04070c 100644 --- a/DuckDuckGo/HomePageConfiguration.swift +++ b/DuckDuckGo/HomePageConfiguration.swift @@ -23,6 +23,7 @@ import RemoteMessaging import Common import Core import Bookmarks +import os.log final class HomePageConfiguration: HomePageMessagesConfiguration { @@ -79,14 +80,14 @@ final class HomePageConfiguration: HomePageMessagesConfiguration { private func remoteMessageToShow() -> HomeMessage? { guard let remoteMessageToPresent = remoteMessagingClient.store.fetchScheduledRemoteMessage() else { return nil } - os_log("Remote message to show: %s", log: .remoteMessaging, type: .info, remoteMessageToPresent.id) + Logger.remoteMessaging.info("Remote message to show: \(remoteMessageToPresent.id)") return .remoteMessage(remoteMessage: remoteMessageToPresent) } func dismissHomeMessage(_ homeMessage: HomeMessage) { switch homeMessage { case .remoteMessage(let remoteMessage): - os_log("Home message dismissed: %s", log: .remoteMessaging, type: .info, remoteMessage.id) + Logger.remoteMessaging.info("Home message dismissed: \(remoteMessage.id)") remoteMessagingClient.store.dismissRemoteMessage(withID: remoteMessage.id) if let index = homeMessages.firstIndex(of: homeMessage) { @@ -100,14 +101,14 @@ final class HomePageConfiguration: HomePageMessagesConfiguration { func didAppear(_ homeMessage: HomeMessage) { switch homeMessage { case .remoteMessage(let remoteMessage): - os_log("Remote message shown: %s", log: .remoteMessaging, type: .info, remoteMessage.id) + Logger.remoteMessaging.info("Remote message shown: \(remoteMessage.id)") if remoteMessage.isMetricsEnabled { Pixel.fire(pixel: .remoteMessageShown, withAdditionalParameters: additionalParameters(for: remoteMessage.id)) } if !remoteMessagingClient.store.hasShownRemoteMessage(withID: remoteMessage.id) { - os_log("Remote message shown for first time: %s", log: .remoteMessaging, type: .info, remoteMessage.id) + Logger.remoteMessaging.info("Remote message shown for first time: \(remoteMessage.id)") if remoteMessage.isMetricsEnabled { Pixel.fire(pixel: .remoteMessageShownUnique, withAdditionalParameters: additionalParameters(for: remoteMessage.id)) diff --git a/DuckDuckGo/HomeViewController.swift b/DuckDuckGo/HomeViewController.swift index 41cb06953a..4cffd017af 100644 --- a/DuckDuckGo/HomeViewController.swift +++ b/DuckDuckGo/HomeViewController.swift @@ -27,6 +27,7 @@ import Persistence import RemoteMessaging import SwiftUI import BrowserServicesKit +import os.log class HomeViewController: UIViewController, NewTabPage { @@ -183,7 +184,7 @@ class HomeViewController: UIViewController, NewTabPage { @objc func remoteMessagesDidChange() { DispatchQueue.main.async { - os_log("Remote messages did change", log: .remoteMessaging, type: .info) + Logger.remoteMessaging.info("Remote messages did change") self.collectionView.refreshHomeConfiguration() self.refresh() } diff --git a/DuckDuckGo/RemoteMessagingClient.swift b/DuckDuckGo/RemoteMessagingClient.swift index 494da7d3c6..5425931ff8 100644 --- a/DuckDuckGo/RemoteMessagingClient.swift +++ b/DuckDuckGo/RemoteMessagingClient.swift @@ -26,6 +26,7 @@ import BrowserServicesKit import Persistence import Bookmarks import RemoteMessaging +import os.log final class RemoteMessagingClient: RemoteMessagingProcessing { @@ -65,15 +66,14 @@ final class RemoteMessagingClient: RemoteMessagingProcessing { duckPlayerStorage: duckPlayerStorage ) let configFetcher = RemoteMessagingConfigFetcher( - configurationFetcher: ConfigurationFetcher(store: configurationStore, urlSession: .session(), log: .remoteMessaging, eventMapping: nil), + configurationFetcher: ConfigurationFetcher(store: configurationStore, urlSession: .session(), eventMapping: nil), configurationStore: configurationStore ) let remoteMessagingStore = RemoteMessagingStore( database: database, notificationCenter: notificationCenter, errorEvents: errorEvents, - remoteMessagingAvailabilityProvider: remoteMessagingAvailabilityProvider, - log: .remoteMessaging + remoteMessagingAvailabilityProvider: remoteMessagingAvailabilityProvider ) self.init( configMatcherProvider: provider, @@ -146,7 +146,7 @@ extension RemoteMessagingClient { do { try BGTaskScheduler.shared.submit(task) } catch { - os_log("Failed to schedule background task: %@", log: OSLog.remoteMessaging, type: .error, error.localizedDescription) + Logger.remoteMessaging.error("Failed to schedule background task: \(error.localizedDescription, privacy: .public)") } #endif } diff --git a/submodules/privacy-reference-tests b/submodules/privacy-reference-tests index afb4f6128a..a603ff9af2 160000 --- a/submodules/privacy-reference-tests +++ b/submodules/privacy-reference-tests @@ -1 +1 @@ -Subproject commit afb4f6128a3b50d53ddcb1897ea1fb4df6858aa1 +Subproject commit a603ff9af22ca3ff7ce2e7ffbfe18c447d9f23e8