diff --git a/AdGuardSDK/AdGuardSDK.xcodeproj/project.pbxproj b/AdGuardSDK/AdGuardSDK.xcodeproj/project.pbxproj index 81e27166d..02b97477c 100644 --- a/AdGuardSDK/AdGuardSDK.xcodeproj/project.pbxproj +++ b/AdGuardSDK/AdGuardSDK.xcodeproj/project.pbxproj @@ -36,6 +36,11 @@ 2465359826E74B7200234EA5 /* DnsProtection+UserRules.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2465359626E74B7200234EA5 /* DnsProtection+UserRules.swift */; }; 24D0AF3126F0FD7A00187810 /* DnsBackgroundFetchUpdateProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D0AF3026F0FD7A00187810 /* DnsBackgroundFetchUpdateProtocol.swift */; }; 24D0AF3226F0FD7A00187810 /* DnsBackgroundFetchUpdateProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D0AF3026F0FD7A00187810 /* DnsBackgroundFetchUpdateProtocol.swift */; }; + 3D1EA72D27DA39BB005E7153 /* SharedAdGuardSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7EC8A37F26E7697C005244CF /* SharedAdGuardSDK.framework */; }; + 3D1EA72E27DA39BB005E7153 /* SharedAdGuardSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7EC8A37F26E7697C005244CF /* SharedAdGuardSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 3D8EA87A27D12F3300F0172F /* SwiftyBeaver in Frameworks */ = {isa = PBXBuildFile; productRef = 3D8EA87927D12F3300F0172F /* SwiftyBeaver */; }; + 3D8EA88527D1339A00F0172F /* LoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA88427D1339A00F0172F /* LoggerWrapper.swift */; }; + 3D8EA88827D133C600F0172F /* LoggerFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA88727D133C600F0172F /* LoggerFactory.swift */; }; 7E15DFD126E603040020247E /* CompaniesStatisticsTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E15DFD026E603040020247E /* CompaniesStatisticsTest.swift */; }; 7E15DFD326E604920020247E /* ActivityStatisticsMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E15DFD226E604920020247E /* ActivityStatisticsMock.swift */; }; 7E15DFD526E606E60020247E /* DnsTrackersProviderMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E15DFD426E606E60020247E /* DnsTrackersProviderMock.swift */; }; @@ -319,7 +324,6 @@ 7EC8A38926E769B4005244CF /* RequestSender.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E806426C2A04100925F96 /* RequestSender.swift */; }; 7EC8A38A26E769B4005244CF /* ParserProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E806326C2A04100925F96 /* ParserProtocol.swift */; }; 7EC8A38B26E769B4005244CF /* RequestProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E806526C2A04100925F96 /* RequestProtocol.swift */; }; - 7EC8A38C26E769BA005244CF /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E806826C2A04100925F96 /* Logger.swift */; }; 7EC8A38D26E769C1005244CF /* CustomFilterMeta.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E806A26C2A04100925F96 /* CustomFilterMeta.swift */; }; 7EC8A38E26E769C1005244CF /* CustomFilterMetaParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E806B26C2A04100925F96 /* CustomFilterMetaParser.swift */; }; 7EC8A39326E769CA005244CF /* UserDefaultsStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E806E26C2A04100925F96 /* UserDefaultsStorage.swift */; }; @@ -352,7 +356,6 @@ 7EC8A3F126E77DDE005244CF /* ParserProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E806326C2A04100925F96 /* ParserProtocol.swift */; }; 7EC8A3F226E77DDE005244CF /* RequestsFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E806626C2A04100925F96 /* RequestsFactory.swift */; }; 7EC8A3F326E77DDE005244CF /* RequestSender.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E806426C2A04100925F96 /* RequestSender.swift */; }; - 7EC8A3F426E77DE0005244CF /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E806826C2A04100925F96 /* Logger.swift */; }; 7EC8A3F526E77DE3005244CF /* CustomFilterMetaParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E806B26C2A04100925F96 /* CustomFilterMetaParser.swift */; }; 7EC8A3F626E77DE3005244CF /* FilterMetaProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E80EE26C2A05200925F96 /* FilterMetaProtocol.swift */; }; 7EC8A3F726E77DE3005244CF /* CustomFilterMeta.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E806A26C2A04100925F96 /* CustomFilterMeta.swift */; }; @@ -413,7 +416,6 @@ B26B926527198FC800F1D482 /* ParsedHost.swift in Sources */ = {isa = PBXBuildFile; fileRef = B26B925427198FC800F1D482 /* ParsedHost.swift */; }; B26B92672719AA0600F1D482 /* Locale+Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = B26B92662719AA0600F1D482 /* Locale+Language.swift */; }; B26B926A2719AA2800F1D482 /* Locale+LanguageTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B26B92692719AA2800F1D482 /* Locale+LanguageTest.swift */; }; - B29D5367270CE2CB0045CB16 /* SharedAdGuardSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7EC8A37F26E7697C005244CF /* SharedAdGuardSDK.framework */; }; B29D53A0270D24FF0045CB16 /* SharedAdGuardSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7EC8A37F26E7697C005244CF /* SharedAdGuardSDK.framework */; }; B29D53A8270D27960045CB16 /* SharedAdGuardSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = B29D53A7270D27270045CB16 /* SharedAdGuardSDK.h */; settings = {ATTRIBUTES = (Public, ); }; }; B29D53B6270D4A860045CB16 /* SharedAdGuardSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7EC8A37F26E7697C005244CF /* SharedAdGuardSDK.framework */; }; @@ -440,6 +442,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 3D1EA72F27DA39BB005E7153 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D0A0E38C26B16B03005344D2 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 7EC8A37E26E7697C005244CF; + remoteInfo = SharedAdGuardSDK; + }; D04F6AB8271845E100224DEF /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D0A0E38C26B16B03005344D2 /* Project object */; @@ -463,6 +472,20 @@ }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + 3D1EA73127DA39BB005E7153 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 3D1EA72E27DA39BB005E7153 /* SharedAdGuardSDK.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 24195D322719F44000F31547 /* SystemLibsResolv.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SystemLibsResolv.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 24195D342719F44000F31547 /* SystemLibsResolv.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SystemLibsResolv.h; sourceTree = ""; }; @@ -477,6 +500,8 @@ 2456E6F626F24A2A001B1760 /* DnsUserRulesManagersProviderMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DnsUserRulesManagersProviderMock.swift; sourceTree = ""; }; 2465359626E74B7200234EA5 /* DnsProtection+UserRules.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DnsProtection+UserRules.swift"; sourceTree = ""; }; 24D0AF3026F0FD7A00187810 /* DnsBackgroundFetchUpdateProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DnsBackgroundFetchUpdateProtocol.swift; sourceTree = ""; }; + 3D8EA88427D1339A00F0172F /* LoggerWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggerWrapper.swift; sourceTree = ""; }; + 3D8EA88727D133C600F0172F /* LoggerFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggerFactory.swift; sourceTree = ""; }; 7E15DFD026E603040020247E /* CompaniesStatisticsTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompaniesStatisticsTest.swift; sourceTree = ""; }; 7E15DFD226E604920020247E /* ActivityStatisticsMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityStatisticsMock.swift; sourceTree = ""; }; 7E15DFD426E606E60020247E /* DnsTrackersProviderMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DnsTrackersProviderMock.swift; sourceTree = ""; }; @@ -565,7 +590,6 @@ 7E6E806426C2A04100925F96 /* RequestSender.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestSender.swift; sourceTree = ""; }; 7E6E806526C2A04100925F96 /* RequestProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestProtocol.swift; sourceTree = ""; }; 7E6E806626C2A04100925F96 /* RequestsFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestsFactory.swift; sourceTree = ""; }; - 7E6E806826C2A04100925F96 /* Logger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = ""; }; 7E6E806A26C2A04100925F96 /* CustomFilterMeta.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomFilterMeta.swift; sourceTree = ""; }; 7E6E806B26C2A04100925F96 /* CustomFilterMetaParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomFilterMetaParser.swift; sourceTree = ""; }; 7E6E806C26C2A04100925F96 /* CommonError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommonError.swift; sourceTree = ""; }; @@ -769,6 +793,7 @@ buildActionMask = 2147483647; files = ( 7E16F29826FA0E5E00383410 /* OrderedCollections in Frameworks */, + 3D8EA87A27D12F3300F0172F /* SwiftyBeaver in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -787,8 +812,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B29D5367270CE2CB0045CB16 /* SharedAdGuardSDK.framework in Frameworks */, B2C8E9CE27170ED500ACDED8 /* AdGuardSdkDependencies.framework in Frameworks */, + 3D1EA72D27DA39BB005E7153 /* SharedAdGuardSDK.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1094,7 +1119,8 @@ 7E6E806726C2A04100925F96 /* Logger */ = { isa = PBXGroup; children = ( - 7E6E806826C2A04100925F96 /* Logger.swift */, + 3D8EA88427D1339A00F0172F /* LoggerWrapper.swift */, + 3D8EA88727D133C600F0172F /* LoggerFactory.swift */, ); path = Logger; sourceTree = ""; @@ -1739,6 +1765,7 @@ name = SharedAdGuardSDK; packageProductDependencies = ( 7E16F29726FA0E5E00383410 /* OrderedCollections */, + 3D8EA87927D12F3300F0172F /* SwiftyBeaver */, ); productName = SharedAdGuardSDK; productReference = 7EC8A37F26E7697C005244CF /* SharedAdGuardSDK.framework */; @@ -1776,10 +1803,12 @@ D049EB9C26B1868200B8088B /* Sources */, D049EB9D26B1868200B8088B /* Frameworks */, D049EB9E26B1868200B8088B /* Resources */, + 3D1EA73127DA39BB005E7153 /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( + 3D1EA73027DA39BB005E7153 /* PBXTargetDependency */, ); name = "AdGuardSDK-mac"; packageProductDependencies = ( @@ -1862,6 +1891,7 @@ D0A3CF9026E7AADE006E90AD /* XCRemoteSwiftPackageReference "Reachability" */, 7E16F29626FA0E5E00383410 /* XCRemoteSwiftPackageReference "swift-collections" */, D04F6A932718307700224DEF /* XCRemoteSwiftPackageReference "SafariConverterLib" */, + 3D8EA87827D12F3300F0172F /* XCRemoteSwiftPackageReference "SwiftyBeaver" */, ); productRefGroup = D0A0E39626B16B03005344D2 /* Products */; projectDirPath = ""; @@ -2284,6 +2314,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 3D8EA88827D133C600F0172F /* LoggerFactory.swift in Sources */, 7EC8A39E26E769DB005244CF /* UserRulesManagerProtocol.swift in Sources */, 7EC8A39326E769CA005244CF /* UserDefaultsStorage.swift in Sources */, 7EC8A38926E769B4005244CF /* RequestSender.swift in Sources */, @@ -2306,9 +2337,9 @@ 7EC8A39726E769D3005244CF /* UserRuleConverter.swift in Sources */, 7EC8A3A026E769DB005244CF /* UserRulesManager.swift in Sources */, 7EC8A3E626E77D5E005244CF /* Array+Utils.swift in Sources */, - 7EC8A38C26E769BA005244CF /* Logger.swift in Sources */, 7EC8A3BB26E76B4E005244CF /* FilterMetaProtocol.swift in Sources */, 7EC8A39F26E769DB005244CF /* UserRule.swift in Sources */, + 3D8EA88527D1339A00F0172F /* LoggerWrapper.swift in Sources */, 7EC8A39426E769CA005244CF /* ResetableProtocol.swift in Sources */, 7EC8A38A26E769B4005244CF /* ParserProtocol.swift in Sources */, 7EC8A3E726E77D5E005244CF /* NotificationCenter+Utils.swift in Sources */, @@ -2360,7 +2391,6 @@ 7EC8A3F826E77DE6005244CF /* ResetableProtocol.swift in Sources */, 7EAD351126C2B84B001AFB3A /* ExtendedFiltersMetaLocalizations.swift in Sources */, 7EAD34F926C2B4B7001AFB3A /* SafariConfiguration.swift in Sources */, - 7EC8A3F426E77DE0005244CF /* Logger.swift in Sources */, 7EAD350B26C2B7F4001AFB3A /* MetaStorage+Filters.swift in Sources */, 7EC8A3EB26E77DD6005244CF /* DateInterval+Utils.swift in Sources */, D049EE9B26B2F31A00B8088B /* Dictionary+Utils.swift in Sources */, @@ -2399,6 +2429,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 3D1EA73027DA39BB005E7153 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 7EC8A37E26E7697C005244CF /* SharedAdGuardSDK */; + targetProxy = 3D1EA72F27DA39BB005E7153 /* PBXContainerItemProxy */; + }; D04F6AB9271845E100224DEF /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = B2C8E9AE2717008C00ACDED8 /* AdGuardSdkDependencies */; @@ -2433,6 +2468,7 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.5; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2465,6 +2501,7 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.5; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2550,6 +2587,7 @@ INFOPLIST_FILE = AdGuardSDK/Info.plist; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.5; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2566,7 +2604,7 @@ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2,6"; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; @@ -2588,6 +2626,7 @@ INFOPLIST_FILE = AdGuardSDK/Info.plist; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.5; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2604,7 +2643,7 @@ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2,6"; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; @@ -2700,6 +2739,7 @@ INFOPLIST_FILE = AdGuardSDK/Info.plist; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.5; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2712,10 +2752,11 @@ PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SKIP_INSTALL = YES; + SUPPORTS_MACCATALYST = YES; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2,6"; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; @@ -2737,6 +2778,7 @@ INFOPLIST_FILE = AdGuardSDK/Info.plist; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.5; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2749,10 +2791,11 @@ PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SKIP_INSTALL = YES; + SUPPORTS_MACCATALYST = YES; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2,6"; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; @@ -2774,6 +2817,7 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.5; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2809,6 +2853,7 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.5; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -3040,6 +3085,7 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.5; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -3075,6 +3121,7 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + "IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.5; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -3179,6 +3226,14 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ + 3D8EA87827D12F3300F0172F /* XCRemoteSwiftPackageReference "SwiftyBeaver" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/SwiftyBeaver/SwiftyBeaver"; + requirement = { + kind = exactVersion; + version = 1.9.5; + }; + }; 7E16F29626FA0E5E00383410 /* XCRemoteSwiftPackageReference "swift-collections" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/apple/swift-collections.git"; @@ -3230,6 +3285,11 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ + 3D8EA87927D12F3300F0172F /* SwiftyBeaver */ = { + isa = XCSwiftPackageProductDependency; + package = 3D8EA87827D12F3300F0172F /* XCRemoteSwiftPackageReference "SwiftyBeaver" */; + productName = SwiftyBeaver; + }; 7E16F29726FA0E5E00383410 /* OrderedCollections */ = { isa = XCSwiftPackageProductDependency; package = 7E16F29626FA0E5E00383410 /* XCRemoteSwiftPackageReference "swift-collections" */; diff --git a/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+BackgroundFetch.swift b/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+BackgroundFetch.swift index 8de97c975..7ffc83942 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+BackgroundFetch.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+BackgroundFetch.swift @@ -18,15 +18,17 @@ import SharedAdGuardSDK +private let LOG = LoggerFactory.getLoggerWrapper(DnsProtection.self) + extension DnsProtection { public func updateFiltersInBackground(onFiltersUpdate: @escaping ((_ error: Error?) -> Void)) { workingQueue.async { [weak self] in self?.dnsFiltersManager.updateAllFilters { result in if result.unupdatedFiltersIds.isEmpty { - Logger.logInfo("(DnsProtection+BackgroundFetch) - updateFiltersInBackground; Filters with id = \(result.updatedFiltersIds) were updated") + LOG.info("Filters with id = \(result.updatedFiltersIds) were updated") self?.completionQueue.async { onFiltersUpdate(nil) } } else { - Logger.logError("(DnsProtection+BackgroundFetch) - updateFiltersInBackground; Some filters with id = \(result.unupdatedFiltersIds) were not updated") + LOG.error("Some filters with id = \(result.unupdatedFiltersIds) were not updated") self?.completionQueue.async { onFiltersUpdate(CommonError.error(message: "Some filters were not updated")) } } } diff --git a/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+Configuration.swift b/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+Configuration.swift index 273bd856c..08874ae72 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+Configuration.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+Configuration.swift @@ -48,6 +48,8 @@ public protocol DnsProtectionConfigurationProtocol { func updateConfig(with newConfig: DnsConfigurationProtocol) } +private let LOG = LoggerFactory.getLoggerWrapper("DnsProtection+Configuration") + extension DnsProtection { public var proStatus: Bool { return workingQueue.sync { return configuration.proStatus } @@ -91,7 +93,7 @@ extension DnsProtection { public func updateConfig(with newConfig: DnsConfigurationProtocol) { workingQueue.sync { - Logger.logInfo("(DnsProtection+Configuration) - updateConfig;") + LOG.info("updateConfig") self.configuration.updateConfig(with: newConfig) } } diff --git a/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+Filters.swift b/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+Filters.swift index a8cde8d71..e5dfea614 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+Filters.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+Filters.swift @@ -78,6 +78,8 @@ public protocol DnsProtectionFiltersProtocol { func updateAllFilters(onFilterUpdated: @escaping (_ result: DnsFiltersUpdateResult) -> Void) } +private let LOG = LoggerFactory.getLoggerWrapper("DnsProtection+Filters") + extension DnsProtection { public var filters: [DnsFilter] { @@ -103,20 +105,20 @@ extension DnsProtection { public func setFilter(withId id: Int, to enabled: Bool) throws { try workingQueue.sync { try dnsFiltersManager.setFilter(withId: id, to: enabled) - Logger.logInfo("(DnsProtection+Filters - setFilter; Enabled state for filter with id = \(id) is = \(enabled)") + LOG.info("Enabled state for filter with id = \(id) is = \(enabled)") } } public func renameFilter(withId id: Int, to name: String) throws { try workingQueue.sync { try dnsFiltersManager.renameFilter(withId: id, to: name) - Logger.logInfo("(DnsProtection+Filters - renameFilter; Filter with id = \(id) was renamed to \(name)") + LOG.info("Filter with id = \(id) was renamed to \(name)") } } public func addFilter(withName name: String, url: URL, isEnabled: Bool, onFilterAdded: @escaping (Error?) -> Void) { workingQueue.sync { - Logger.logInfo("(DnsProtection+Filters - addFilter; Start add filter with name = \(name), url = \(url), is enabled = \(isEnabled)") + LOG.info("Start add filter with name = \(name), url = \(url), is enabled = \(isEnabled)") dnsFiltersManager.addFilter(withName: name, url: url, isEnabled: isEnabled, onFilterAdded: onFilterAdded) } } @@ -124,20 +126,20 @@ extension DnsProtection { public func removeFilter(withId id: Int) throws { try workingQueue.sync { try dnsFiltersManager.removeFilter(withId: id) - Logger.logInfo("(DnsProtection+Filters - removeFilter; Filter with id = \(id) was removed") + LOG.info("Filter with id = \(id) was removed") } } public func updateFilter(withId id: Int, onFilterUpdated: @escaping (_ error: Error?) -> Void) { workingQueue.sync { - Logger.logInfo("(DnsProtection+Filters) - updateFilter; Start updating filter with id = \(id)") + LOG.info("Start updating filter with id = \(id)") dnsFiltersManager.updateFilter(withId: id, onFilterUpdated: onFilterUpdated) } } public func updateAllFilters(onFilterUpdated: @escaping (_ result: DnsFiltersUpdateResult) -> Void) { workingQueue.sync { - Logger.logInfo("(DnsProtection+Filters) - updateAllFilters; Start updating all filters") + LOG.info("Start updating all filters") dnsFiltersManager.updateAllFilters(onFilterUpdated: onFilterUpdated) } } diff --git a/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+UserRules.swift b/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+UserRules.swift index 544c1ebb5..ee60e1c20 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+UserRules.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/DnsProtection/DnsProtection+UserRules.swift @@ -121,10 +121,12 @@ public protocol DnsProtectionUserRulesManagerProtocol { func checkEnabledRuleExists(_ rule: String, for type: DnsUserRuleType)->Bool } +private let LOG = LoggerFactory.getLoggerWrapper("DnsProtection+UserRules") + extension DnsProtection { public func rulesString(for type: DnsUserRuleType) -> String { workingQueue.sync { - Logger.logInfo("(DnsProtection+UserRules) - rulesString; Returning rules string for type=\(type)") + LOG.info("Returning rules string for type=\(type)") let manager = getManager(for: type) return manager.rulesString } @@ -132,7 +134,7 @@ extension DnsProtection { public func allRules(for type: DnsUserRuleType) -> [UserRule] { workingQueue.sync { - Logger.logInfo("(DnsProtection+UserRules) - allRules; Returning all rules for type=\(type)") + LOG.info("Returning all rules for type=\(type)") let manager = getManager(for: type) return manager.allRules } @@ -140,7 +142,7 @@ extension DnsProtection { public func add(rule: UserRule, override: Bool, for type: DnsUserRuleType) throws { try workingQueue.sync { - Logger.logInfo("(DnsProtection+UserRules) - addRule; Adding rule: \(rule); for type=\(type); override=\(override)") + LOG.info("Adding rule: \(rule); for type=\(type); override=\(override)") let manager = getManager(for: type) try manager.add(rule: rule, override: override) } @@ -148,7 +150,7 @@ extension DnsProtection { public func add(rules: [UserRule], override: Bool, for type: DnsUserRuleType) throws { try workingQueue.sync { - Logger.logInfo("(DnsProtection+UserRules) - addRules; Adding \(rules.count) rules; for type=\(type); override=\(override)") + LOG.info("Adding \(rules.count) rules; for type=\(type); override=\(override)") let manager = getManager(for: type) try manager.add(rules: rules, override: override) } @@ -156,7 +158,7 @@ extension DnsProtection { public func set(rules: [String], for type: DnsUserRuleType) { workingQueue.sync { - Logger.logInfo("(DnsProtection+UserRules) - setRules; Setting \(rules.count) rules; for type=\(type)") + LOG.info("Setting \(rules.count) rules; for type=\(type)") let manager = getManager(for: type) manager.set(rules: rules) } @@ -164,7 +166,7 @@ extension DnsProtection { public func modifyRule(_ oldRuleText: String, _ newRule: UserRule, for type: DnsUserRuleType) throws { try workingQueue.sync { - Logger.logInfo("(DnsProtection+UserRules) - modifyRule; Modifying old rule=\(oldRuleText) to new rule=\(newRule)") + LOG.info("Modifying old rule=\(oldRuleText) to new rule=\(newRule)") let manager = getManager(for: type) try manager.modifyRule(oldRuleText, newRule) } @@ -172,7 +174,7 @@ extension DnsProtection { public func turnRules(_ rules: [String], on: Bool, for type: DnsUserRuleType) { workingQueue.sync { - Logger.logInfo("(DnsProtection+UserRules) - turnRules; Turning \(rules.count) rules on=\(on) for type=\(type)") + LOG.info("Turning \(rules.count) rules on=\(on) for type=\(type)") let manager = getManager(for: type) rules.forEach { try? manager.modifyRule($0, UserRule(ruleText: $0, isEnabled: on)) @@ -182,7 +184,7 @@ extension DnsProtection { public func removeRule(withText ruleText: String, for type: DnsUserRuleType) throws { try workingQueue.sync { - Logger.logInfo("(DnsProtection+UserRules) - removeRule; Removing rule=\(ruleText) for type=\(type)") + LOG.info("Removing rule=\(ruleText) for type=\(type)") let manager = getManager(for: type) try manager.removeRule(withText: ruleText) } @@ -190,7 +192,7 @@ extension DnsProtection { public func removeRules(_ rules: [String], for type: DnsUserRuleType) { workingQueue.sync { - Logger.logInfo("(DnsProtection+UserRules) - removeRules; Removing \(rules.count) rules for type=\(type)") + LOG.info("Removing \(rules.count) rules for type=\(type)") let manager = getManager(for: type) rules.forEach { try? manager.removeRule(withText: $0) @@ -200,7 +202,7 @@ extension DnsProtection { public func removeAllRules(for type: DnsUserRuleType) { workingQueue.sync { - Logger.logInfo("(DnsProtection+UserRules) - removeAllRules; Removing all rules for type=\(type)") + LOG.info("Removing all rules for type=\(type)") let manager = getManager(for: type) manager.removeAllRules() } diff --git a/AdGuardSDK/AdGuardSDK/DNS/DnsProviders/DnsProvidersManager/DnsProvidersManager.swift b/AdGuardSDK/AdGuardSDK/DNS/DnsProviders/DnsProvidersManager/DnsProvidersManager.swift index 4a91c18b3..e034f024d 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/DnsProviders/DnsProvidersManager/DnsProvidersManager.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/DnsProviders/DnsProvidersManager/DnsProvidersManager.swift @@ -78,6 +78,8 @@ public protocol DnsProvidersManagerProtocol: ResetableSyncProtocol { func removeCustomProvider(withId id: Int) throws } +private let LOG = LoggerFactory.getLoggerWrapper(DnsProvidersManager.self) + final public class DnsProvidersManager: DnsProvidersManagerProtocol { // MARK: - Internal variables @@ -120,7 +122,7 @@ final public class DnsProvidersManager: DnsProvidersManagerProtocol { userDefaults: UserDefaultsStorageProtocol, customProvidersStorage: CustomDnsProvidersStorageProtocol, predefinedProviders: PredefinedDnsProvidersDecoderProtocol) { - Logger.logInfo("(DnsProvidersManager) - init start") + LOG.info("Init start") self.configuration = configuration self.userDefaults = userDefaults self.customProvidersStorage = customProvidersStorage @@ -132,19 +134,19 @@ final public class DnsProvidersManager: DnsProvidersManagerProtocol { self.customProviders = providersWithState.custom self.activeDnsProvider = providersWithState.activeDnsProvider self.activeDnsServer = providersWithState.activeDnsServer - Logger.logInfo("(DnsProvidersManager) - init end") + LOG.info("Init end") } // MARK: - Public methods public func update(dnsImplementation: DnsImplementation) { - Logger.logInfo("(DnsProvidersManager) - updateDnsImplementation; Changed to \(dnsImplementation)") + LOG.info("Changed to \(dnsImplementation)") configuration.dnsImplementation = dnsImplementation reinitializeProviders() } public func selectProvider(withId id: Int, serverId: Int) throws { - Logger.logInfo("(DnsProvidersManager) - selectProvider; Selecting provider with id=\(id) serverId=\(serverId)") + LOG.info("Selecting provider with id=\(id) serverId=\(serverId)") guard let provider = allProviders.first(where: { $0.providerId == id }) else { throw DnsProviderError.invalidProvider(providerId: id) @@ -158,13 +160,13 @@ final public class DnsProvidersManager: DnsProvidersManagerProtocol { userDefaults.activeDnsInfo = newActiveDnsInfo reinitializeProviders() - Logger.logInfo("(DnsProvidersManager) - selectProvider; Selected provider with id=\(id) serverId=\(serverId)") + LOG.info("Selected provider with id=\(id) serverId=\(serverId)") } // TODO: - It's a crutch, should be refactored /// isMigration parameter is a crutch to quickly migrate custom DNS providers without checking their upstreams public func addCustomProvider(name: String, upstreams: [String], selectAsCurrent: Bool, isMigration: Bool) throws { - Logger.logInfo("(DnsProvidersManager) - addCustomProvider; Trying to add custom provider with name=\(name), upstreams=\(upstreams.joined(separator: "; ")) selectAsCurrent=\(selectAsCurrent)") + LOG.info("Trying to add custom provider with name=\(name), upstreams=\(upstreams.joined(separator: "; ")) selectAsCurrent=\(selectAsCurrent)") // check server exists let servers = customProvidersStorage.providers.map { $0.server } @@ -183,11 +185,11 @@ final public class DnsProvidersManager: DnsProvidersManagerProtocol { reinitializeProviders() - Logger.logInfo("(DnsProvidersManager) - addCustomProvider; Added custom provider with name=\(name), upstreams=\(upstreams.joined(separator: "; ")) selectAsCurrent=\(selectAsCurrent)") + LOG.info("Added custom provider with name=\(name), upstreams=\(upstreams.joined(separator: "; ")) selectAsCurrent=\(selectAsCurrent)") } public func updateCustomProvider(withId id: Int, newName: String, newUpstreams: [String], selectAsCurrent: Bool) throws { - Logger.logInfo("(DnsProvidersManager) - updateCustomProvider; Trying to update custom provider with id=\(id) name=\(newName), upstreams=\(newUpstreams.joined(separator: "; ")) selectAsCurrent=\(selectAsCurrent)") + LOG.info("Trying to update custom provider with id=\(id) name=\(newName), upstreams=\(newUpstreams.joined(separator: "; ")) selectAsCurrent=\(selectAsCurrent)") // check another server with given upstream exists let servers = customProvidersStorage.providers.compactMap { @@ -208,11 +210,11 @@ final public class DnsProvidersManager: DnsProvidersManagerProtocol { } reinitializeProviders() - Logger.logInfo("(DnsProvidersManager) - updateCustomProvider; Updated custom provider with id=\(id) name=\(newName), upstreams=\(newUpstreams.joined(separator: "; ")) selectAsCurrent=\(selectAsCurrent)") + LOG.info("Updated custom provider with id=\(id) name=\(newName), upstreams=\(newUpstreams.joined(separator: "; ")) selectAsCurrent=\(selectAsCurrent)") } public func removeCustomProvider(withId id: Int) throws { - Logger.logInfo("(DnsProvidersManager) - removeCustomProvider; Trying to remove provider with id=\(id)") + LOG.info("Trying to remove provider with id=\(id)") try customProvidersStorage.removeCustomProvider(withId: id) @@ -224,11 +226,11 @@ final public class DnsProvidersManager: DnsProvidersManagerProtocol { } reinitializeProviders() - Logger.logInfo("(DnsProvidersManager) - removeCustomProvider; Removed provider with id=\(id)") + LOG.info("Removed provider with id=\(id)") } public func reset() throws { - Logger.logInfo("(DnsProvidersManager) - reset; Start") + LOG.info("Start resettings") let defaultProviderId = PredefinedDnsProvider.systemDefaultProviderId let defaultServerId = PredefinedDnsServer.systemDefaultServerId @@ -237,7 +239,7 @@ final public class DnsProvidersManager: DnsProvidersManagerProtocol { try! customProvidersStorage.reset() reinitializeProviders() - Logger.logInfo("(DnsProvidersManager) - reset; Finish") + LOG.info("Finish resettings") } // MARK: - Private methods diff --git a/AdGuardSDK/AdGuardSDK/DNS/DnsProviders/Predefined/PredefinedDnsProvidersDecoder.swift b/AdGuardSDK/AdGuardSDK/DNS/DnsProviders/Predefined/PredefinedDnsProvidersDecoder.swift index 8a59b8aef..27120f161 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/DnsProviders/Predefined/PredefinedDnsProvidersDecoder.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/DnsProviders/Predefined/PredefinedDnsProvidersDecoder.swift @@ -22,6 +22,8 @@ protocol PredefinedDnsProvidersDecoderProtocol { var providers: [PredefinedDnsProvider] { get } } +private let LOG = LoggerFactory.getLoggerWrapper(PredefinedDnsProvidersDecoder.self) + /** Decodes **providers.json** and **providers_i18n.json** and returns their data as an object File **providers.json** contains JSON with information about predefined DNS providers @@ -119,7 +121,7 @@ struct PredefinedDnsProvidersDecoder: PredefinedDnsProvidersDecoderProtocol { /* Returns json Data from file name */ private func getData(forFileName fileName: String) throws -> Data { guard let pathString = bundle.path(forResource: fileName, ofType: "json") else { - Logger.logError("(DnsProvidersDecoder) - getData; Failed to get \(fileName).json path") + LOG.error("Failed to get \(fileName).json path") throw CommonError.missingFile(filename: "\(fileName).json") } let pathUrl = URL(fileURLWithPath: pathString) diff --git a/AdGuardSDK/AdGuardSDK/DNS/FilteringRules/DnsFilters/DnsFiltersManager.swift b/AdGuardSDK/AdGuardSDK/DNS/FilteringRules/DnsFilters/DnsFiltersManager.swift index 40272b8b1..bcc082971 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/FilteringRules/DnsFilters/DnsFiltersManager.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/FilteringRules/DnsFilters/DnsFiltersManager.swift @@ -75,6 +75,8 @@ protocol DnsFiltersManagerProtocol: ResetableSyncProtocol { func getDnsLibsFilters() -> [Int: String] } +private let LOG = LoggerFactory.getLoggerWrapper(DnsFiltersManager.self) + /** This class is responsible for managing DNS filters files, meta from server and meta from user It also allows user to configure editable DNS filter meta and control filters state @@ -125,7 +127,7 @@ final class DnsFiltersManager: DnsFiltersManagerProtocol { func setFilter(withId id: Int, to enabled: Bool) throws { try workingQueue.sync { - Logger.logInfo("(DnsFiltersService) - setFilter; Trying to set filter with id=\(id) to enabled=\(enabled)") + LOG.info("Trying to set filter with id=\(id) to enabled=\(enabled)") if let filterIndex = filters.firstIndex(where: { $0.filterId == id }) { filters[filterIndex].isEnabled = enabled @@ -133,13 +135,13 @@ final class DnsFiltersManager: DnsFiltersManagerProtocol { throw DnsFilterError.dnsFilterAbsent(filterId: id) } - Logger.logInfo("(DnsFiltersService) - setFilter; Set filter with id=\(id) to enabled=\(enabled)") + LOG.info("Set filter with id=\(id) to enabled=\(enabled)") } } func renameFilter(withId id: Int, to name: String) throws { try workingQueue.sync { - Logger.logInfo("(DnsFiltersService) - renameFilter; Renaming filter with id=\(id) to name=\(name)") + LOG.info("Renaming filter with id=\(id) to name=\(name)") if let filterIndex = filters.firstIndex(where: { $0.filterId == id }) { filters[filterIndex].name = name @@ -147,7 +149,7 @@ final class DnsFiltersManager: DnsFiltersManagerProtocol { throw DnsFilterError.dnsFilterAbsent(filterId: id) } - Logger.logInfo("(DnsFiltersService) - renameFilter; Renamed filter with id=\(id) to name=\(name)") + LOG.info("Renamed filter with id=\(id) to name=\(name)") } } @@ -155,7 +157,7 @@ final class DnsFiltersManager: DnsFiltersManagerProtocol { BackgroundTaskExecutor.executeAsynchronousTask("DnsFiltersManager.addFilter") { [weak self] onTaskFinished in self?.workingQueue.async { [weak self] in guard let self = self else { - Logger.logError("(DnsFiltersService) - addFilter; Error: \(CommonError.missingSelf.debugDescription)") + LOG.error("Error: \(CommonError.missingSelf.debugDescription)") DispatchQueue.main.async { onFilterAdded(CommonError.missingSelf) onTaskFinished() @@ -189,7 +191,7 @@ final class DnsFiltersManager: DnsFiltersManagerProtocol { BackgroundTaskExecutor.executeAsynchronousTask("DnsFiltersManager.updateFilter") { [weak self] onTaskFinished in self?.workingQueue.async { [weak self] in guard let self = self else { - Logger.logError("(DnsFiltersService) - updateFilter; Error: \(CommonError.missingSelf.debugDescription)") + LOG.error("Error: \(CommonError.missingSelf.debugDescription)") DispatchQueue.main.async { onFilterUpdated(CommonError.missingSelf) onTaskFinished() @@ -216,14 +218,14 @@ final class DnsFiltersManager: DnsFiltersManagerProtocol { BackgroundTaskExecutor.executeAsynchronousTask("DnsFiltersManager.updateAllFilters") { [weak self] onTaskFinished in self?.workingQueue.async { [weak self] in guard let self = self else { - Logger.logError("(DnsFiltersService) - updateAllFilters; Error: \(CommonError.missingSelf.debugDescription)") + LOG.error("Error: \(CommonError.missingSelf.debugDescription)") DispatchQueue.main.async { onFilterUpdated(DnsFiltersUpdateResult(updatedFiltersIds: [], unupdatedFiltersIds: [])) onTaskFinished() } return } - Logger.logInfo("(DnsFiltersService) - updateAllFilters; Start") + LOG.info("updateAllFilters; Start") var updatedIds: [Int] = [] var unupdatedIds: [Int] = [] @@ -247,7 +249,7 @@ final class DnsFiltersManager: DnsFiltersManagerProtocol { func getDnsLibsFilters() -> [Int: String] { workingQueue.sync { - Logger.logInfo("(DnsFiltersService) - getDnsLibsFilters; DnsFiltering is enabled=\(configuration.dnsFilteringIsEnabled)") + LOG.info("DnsFiltering is enabled=\(configuration.dnsFilteringIsEnabled)") guard configuration.dnsFilteringIsEnabled else { return [:] @@ -273,22 +275,22 @@ final class DnsFiltersManager: DnsFiltersManagerProtocol { // MARK: - Private methods private func addFilter(withName name: String, url: URL, isEnabled: Bool) throws { - Logger.logInfo("(DnsFiltersService) - addFilter; Trying to add filter with name=\(name) url=\(url)") + LOG.info("Trying to add filter with name=\(name) url=\(url)") if filters.contains(where: { $0.subscriptionUrl == url }) { throw DnsFilterError.dnsFilterExists(subscriptionUrl: url.absoluteString) } - + let filterId = nextFilterId let result = try updateFilterSync(with: filterId, url: url) let filter = DnsFilter(meta: result, name: name, filterId: filterId, subscriptionUrl: url, isEnabled: isEnabled) self.filters.append(filter) - Logger.logInfo("(DnsFiltersService) - addFilter; Added DNS filter with name=\(name) url=\(url)") + LOG.info("Added DNS filter with name=\(name) url=\(url)") } private func updateFilter(withId id: Int) throws { - Logger.logInfo("(DnsFiltersService) - updateFilter; Trying to update DNS filter with id=\(id)") + LOG.info("Trying to update DNS filter with id=\(id)") guard let dnsFilterIndex = filters.firstIndex(where: { $0.filterId == id }) else { throw DnsFilterError.dnsFilterAbsent(filterId: id) @@ -300,7 +302,7 @@ final class DnsFiltersManager: DnsFiltersManagerProtocol { let newFilter = DnsFilter(meta: result, name: dnsFilter.name ?? "", filterId: dnsFilter.filterId, subscriptionUrl: dnsFilter.subscriptionUrl, isEnabled: dnsFilter.isEnabled) self.filters[dnsFilterIndex] = newFilter - Logger.logInfo("(DnsFiltersService) - updateFilter; Updated DNS filter with id=\(id)") + LOG.info("Updated DNS filter with id=\(id)") } private func updateFilterSync(with filterId: Int, url: URL) throws -> ExtendedCustomFilterMetaProtocol? { @@ -316,7 +318,7 @@ final class DnsFiltersManager: DnsFiltersManagerProtocol { } if let error = error { - Logger.logError("(DnsFiltersService) - updateFilterSync; Error updating custom DNS filter; Error: \(error)") + LOG.error("Error updating custom DNS filter; Error: \(error)") resultError = error group.leave() return @@ -327,7 +329,7 @@ final class DnsFiltersManager: DnsFiltersManagerProtocol { do { filterMeta = try self.metaParser.parse(filterContent, for: .system, filterDownloadPage: url.absoluteString) } catch { - Logger.logError("(DnsFiltersService) - updateFilterSync; Parsing error occurred: \(error)") + LOG.error("Parsing error occurred: \(error)") resultError = error } } diff --git a/AdGuardSDK/AdGuardSDK/DNS/FilteringRules/UserRules/DnsUserRulesManagersProvider.swift b/AdGuardSDK/AdGuardSDK/DNS/FilteringRules/UserRules/DnsUserRulesManagersProvider.swift index 9b3a52cea..b8aa8ff6e 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/FilteringRules/UserRules/DnsUserRulesManagersProvider.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/FilteringRules/UserRules/DnsUserRulesManagersProvider.swift @@ -23,6 +23,8 @@ protocol DnsUserRulesManagersProviderProtocol: ResetableSyncProtocol { var allowlistRulesManager: UserRulesManagerProtocol { get } } +private let LOG = LoggerFactory.getLoggerWrapper(DnsUserRulesManagersProvider.self) + final class DnsUserRulesManagersProvider: DnsUserRulesManagersProviderProtocol { let blocklistRulesManager: UserRulesManagerProtocol let allowlistRulesManager: UserRulesManagerProtocol @@ -41,11 +43,11 @@ final class DnsUserRulesManagersProvider: DnsUserRulesManagersProviderProtocol { } func reset() throws { - Logger.logInfo("(UserRulesManagersProvider) - reset start") + LOG.info("Reset start") try blocklistRulesManager.reset() try allowlistRulesManager.reset() - Logger.logInfo("(UserRulesManagersProvider) - reset; Successfully reset all user rules managers") + LOG.info("Successfully reset all user rules managers") } } diff --git a/AdGuardSDK/AdGuardSDK/DNS/FilteringRules/UserRules/DnsUserRulesStorage.swift b/AdGuardSDK/AdGuardSDK/DNS/FilteringRules/UserRules/DnsUserRulesStorage.swift index 981baba6c..c7453b5eb 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/FilteringRules/UserRules/DnsUserRulesStorage.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/FilteringRules/UserRules/DnsUserRulesStorage.swift @@ -19,6 +19,8 @@ import OrderedCollections import SharedAdGuardSDK +private let LOG = LoggerFactory.getLoggerWrapper(DnsUserRulesStorage.self) + final class DnsUserRulesStorage: UserRulesStorageProtocol { var rules: OrderedSet { @@ -61,7 +63,7 @@ final class DnsUserRulesStorage: UserRulesStorageProtocol { // fileStorage should be passed as new object with unique folder to avoid filters ids collisions init(type: DnsUserRuleType, fileStorage: FilterFilesStorageProtocol, readOnly: Bool = false) { - Logger.logInfo("(DnsUserRulesStorage) - init start") + LOG.info("Init start") self.type = type self.fileStorage = fileStorage @@ -78,24 +80,24 @@ final class DnsUserRulesStorage: UserRulesStorageProtocol { // Create empty file if doesn't exist for all rules if fileStorage.getFilterContentForFilter(withId: type.allRulesFilterId) == nil { do { - Logger.logInfo("(DnsUserRulesStorage) - filter \(type.allRulesFilterId) not found, creating an empty filter") + LOG.info("Filter \(type.allRulesFilterId) not found, creating an empty filter") try fileStorage.saveFilter(withId: type.allRulesFilterId, filterContent: "") } catch { - Logger.logError("(DnsUserRulesStorage) - init; Failed to create empty file with id=\(type.allRulesFilterId). It can lead to various errors") + LOG.error("Failed to create empty file with id=\(type.allRulesFilterId). It can lead to various errors") } } // Create empty file if doesn't exist for enabled rules if fileStorage.getFilterContentForFilter(withId: type.enabledRulesFilterId) == nil { do { - Logger.logInfo("(DnsUserRulesStorage) - filter \(type.enabledRulesFilterId) not found, creating an empty filter") + LOG.info("Filter \(type.enabledRulesFilterId) not found, creating an empty filter") try fileStorage.saveFilter(withId: type.enabledRulesFilterId, filterContent: "") } catch { - Logger.logError("(DnsUserRulesStorage) - init; Failed to create empty file with id=\(type.enabledRulesFilterId). It can lead to various errors") + LOG.error("Failed to create empty file with id=\(type.enabledRulesFilterId). It can lead to various errors") } } } - Logger.logInfo("(DnsUserRulesStorage) - init end") + LOG.info("Init end") } // MARK: - Private methods @@ -112,7 +114,7 @@ final class DnsUserRulesStorage: UserRulesStorageProtocol { do { try fileStorage.saveFilter(withId: type.allRulesFilterId, filterContent: rulesString) } catch { - Logger.logError("(DnsUserRulesStorage) - saveAllRules; Error saving all rules; Error: \(error)") + LOG.error("Error saving all rules; Error: \(error)") } } @@ -128,7 +130,7 @@ final class DnsUserRulesStorage: UserRulesStorageProtocol { do { try fileStorage.saveFilter(withId: type.enabledRulesFilterId, filterContent: rulesString) } catch { - Logger.logError("(DnsUserRulesStorage) - saveEnabledRules; Error saving enabled rules; Error: \(error)") + LOG.error("Error saving enabled rules; Error: \(error)") } } } diff --git a/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/DnsProxy.swift b/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/DnsProxy.swift index 731376c8e..8048b0738 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/DnsProxy.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/DnsProxy.swift @@ -25,6 +25,8 @@ protocol DnsProxyProtocol: AnyObject { func resolve(dnsRequest: Data, onRequestResolved: @escaping (Data?) -> Void) } +private let LOG = LoggerFactory.getLoggerWrapper(DnsProxy.self) + /// This object is a wrapper arround `AGDnsProxy` /// It is used to control proxy lifecycle /// and to resolve requests that we obtain from `PacketTunnelProvider` @@ -59,11 +61,11 @@ final class DnsProxy: DnsProxyProtocol { func stop() { resolveQueue.sync(flags: .barrier) { [weak self] in - Logger.logInfo("(DnsProxy) - stop") + LOG.info("Stop") self?.proxy?.stop() self?.proxy = nil self?.proxySettingsProvider.reset() - Logger.logInfo("(DnsProxy) - stopped") + LOG.info("Stopped") } } @@ -77,7 +79,7 @@ final class DnsProxy: DnsProxyProtocol { // MARK: - Private methods private func internalStart(_ systemDnsUpstreams: [DnsUpstream]) -> Error? { - Logger.logInfo("(DnsProxy) - start") + LOG.info("Start") // Configuration if proxy != nil { @@ -99,7 +101,7 @@ final class DnsProxy: DnsProxyProtocol { ) } catch { - Logger.logError("(DnsProxy) - internalStart; Error initializing statistics: \(error)") + LOG.error("Error initializing statistics: \(error)") return error } @@ -113,19 +115,19 @@ final class DnsProxy: DnsProxyProtocol { // Error reference var error: NSError? - Logger.logInfo("(DnsProxy) start with config: \n\(agConfig.extendedDescription)") + LOG.info("Start with config: \n\(agConfig.extendedDescription)") // Proxy init proxy = AGDnsProxy(config: agConfig, handler: agEvents, error: &error) if let error = error { - Logger.logError("(DnsProxy) - started with error: \(error)") + LOG.error("Started with error: \(error)") return error } else if proxy != nil { - Logger.logInfo("(DnsProxy) - started successfully") + LOG.info("Started successfully") return nil } else { - Logger.logError("(DnsProxy) - started with unknown error") + LOG.error("Started with unknown error") assertionFailure("Error and AGDnsProxy can't be both nil at the same time") return CommonError.missingData } diff --git a/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/PacketTunnelProvider.swift b/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/PacketTunnelProvider.swift index e3e7e7e72..36139a400 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/PacketTunnelProvider.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/PacketTunnelProvider.swift @@ -20,6 +20,8 @@ import NetworkExtension import Reachability import SharedAdGuardSDK +private let LOG = LoggerFactory.getLoggerWrapper(PacketTunnelProvider.self) + /** This object gives access to a virtual network interface It contains all thelogic needed for tunnel to be run @@ -76,7 +78,7 @@ open class PacketTunnelProvider: NEPacketTunnelProvider { statisticsDbContainerUrl: URL, networkUtils: NetworkUtilsProtocol ) throws { - Logger.logInfo("(PacketTunnelProvider) init start") + LOG.info("Init start") let userDefaultsStorage = UserDefaultsStorage(storage: userDefaults) let dnsProvidersManager = try DnsProvidersManager(configuration: dnsConfiguration, userDefaults: userDefaultsStorage, networkUtils: networkUtils) @@ -129,28 +131,28 @@ open class PacketTunnelProvider: NEPacketTunnelProvider { tunnelProxy.delegate = self - Logger.logInfo("(PacketTunnelProvider) init finished") + LOG.info("Init finished") } // MARK: packet tunnel lifecycle public override func startTunnel(options: [String : NSObject]? = nil, completionHandler: @escaping (Error?) -> Void) { - Logger.logInfo("(PacketTunnelProvider) startTunnel") + LOG.info("StartTunnel") do { try reachabilityHandler.startNotifier() } catch { - Logger.logError("Reachability handler start error: \(error)") + LOG.error("Reachability handler start error: \(error)") completionHandler(error) return } tunnelProxy.startTunnel(options: options) { [weak self] error in if error == nil { - Logger.logInfo("(PacketTunnelProvider) startTunnel; finished starting") + LOG.info("Finished starting") } else { - Logger.logInfo("(PacketTunnelProvider) startTunnel; finished starting with error: \(error!)") + LOG.info("Finished starting with error: \(error!)") } self?.startReachabilityHandling() completionHandler(error) @@ -158,18 +160,18 @@ open class PacketTunnelProvider: NEPacketTunnelProvider { } public override func stopTunnel(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) { - Logger.logInfo("(PacketTunnelProvider) stopTunnel with reason: \(reason)") + LOG.info("stopTunnel with reason: \(reason)") reachabilityHandler.stopNotifier() tunnelProxy.stopTunnel(with: reason, completionHandler: completionHandler) } public override func sleep(completionHandler: @escaping () -> Void) { - Logger.logInfo("(PacketTunnelProvider) Sleep Event") + LOG.info("Sleep Event") tunnelProxy.sleep(completionHandler: completionHandler) } public override func wake() { - Logger.logInfo("(PacketTunnelProvider) Wake Event") + LOG.info("Wake Event") tunnelProxy.wake() } @@ -180,7 +182,7 @@ open class PacketTunnelProvider: NEPacketTunnelProvider { guard let self = self, let reachability = note.object as? Reachability else { return } let currentConnection = reachability.connection - Logger.logInfo("Reachability connection changed from \(self.reachabilityConnection) to \(currentConnection)") + LOG.info("Reachability connection changed from \(self.reachabilityConnection) to \(currentConnection)") // However, we don't need to restart tunnel when there is no connection. if currentConnection != .unavailable && currentConnection != self.reachabilityConnection { diff --git a/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/PacketTunnelProviderProxy.swift b/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/PacketTunnelProviderProxy.swift index 7d4182a38..ec48b3165 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/PacketTunnelProviderProxy.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/PacketTunnelProviderProxy.swift @@ -39,6 +39,8 @@ protocol PacketTunnelProviderProxyProtocol: AnyObject { func networkChanged() } +private let LOG = LoggerFactory.getLoggerWrapper(PacketTunnelProviderProxy.self) + /** Proxy is a design pattern, that perfectly fits it this case. You can find more info here https://refactoring.guru/design-patterns/proxy We use this tunnel proxy to be able to test tunnel behaviour @@ -116,19 +118,19 @@ final class PacketTunnelProviderProxy: PacketTunnelProviderProxyProtocol { guard let self = self else { return } let shouldRestartWhenNetworkChanges = self.dnsConfiguration.lowLevelConfiguration.restartByReachability - Logger.logInfo("(PacketTunnelProviderProxy) - networkChanged; shouldRestartWhenNetworkChanges=\(shouldRestartWhenNetworkChanges)") + LOG.info("shouldRestartWhenNetworkChanges=\(shouldRestartWhenNetworkChanges)") // Stop packet handling and dnsProxy right away - Logger.logInfo("(PacketTunnelProviderProxy) - stopping packet handling") + LOG.info("Stopping packet handling") self.stopPacketHanding() - Logger.logInfo("(PacketTunnelProviderProxy) - stopping dnsProxy") + LOG.info("Stopping dnsProxy") self.dnsProxy.stop() // If the user has enabled "restartByReachability", we reinitialize the whole PacketTunnelProvider on every network change // This is done by cancelling tunnel (it will be then restarted back automatically due to the on-demand rules) if shouldRestartWhenNetworkChanges { - Logger.logInfo("(PacketTunnelProviderProxy) - cancelling tunnel") + LOG.info("Cancelling tunnel") self.delegate?.cancelTunnel(with: nil) return } @@ -136,13 +138,13 @@ final class PacketTunnelProviderProxy: PacketTunnelProviderProxyProtocol { // This is the default behavior, we restart proxy internally without reinitializing PacketTunnelProvider. let group = DispatchGroup() group.enter() - Logger.logInfo("(PacketTunnelProviderProxy) - starting the tunnel") + LOG.info("Starting the tunnel") self.startTunnel { [weak self] error in if let error = error { - Logger.logError("(PacketTunnelProviderProxy) - networkChanged; Error: \(error)") + LOG.error("Error: \(error)") self?.delegate?.cancelTunnel(with: error) } else { - Logger.logInfo("(PacketTunnelProviderProxy) - networkChanged; Successfully restarted proxy after the network change") + LOG.info("Successfully restarted proxy after the network change") } group.leave() } @@ -157,7 +159,7 @@ final class PacketTunnelProviderProxy: PacketTunnelProviderProxyProtocol { updateTunnelSettings { [weak self] result in guard let self = self else { let error = CommonError.missingSelf - Logger.logError("(PacketTunnelProviderProxy) - startTunnel; Error: \(error)") + LOG.error("Error: \(error)") onTunnelStarted(error) return } @@ -181,7 +183,7 @@ final class PacketTunnelProviderProxy: PacketTunnelProviderProxyProtocol { let allSystemServers = networkUtils.systemDnsServers - Logger.logInfo("updateTunnelSettings with system servers: \(allSystemServers)") + LOG.info("updateTunnelSettings with system servers: \(allSystemServers)") let systemDnsServers = allSystemServers.filter { $0 != addresses.localDnsIpv4 && $0 != addresses.localDnsIpv6 } @@ -190,7 +192,7 @@ final class PacketTunnelProviderProxy: PacketTunnelProviderProxyProtocol { // Check if user's already provided all needed settings if providersManager.activeDnsServer.upstreams.count > 0 && hasFallbacks && hasBootstraps || !systemDnsServers.isEmpty { - Logger.logInfo("(PacketTunnelProviderProxy) - updateTunnelSettings; All settings we need are set by the user, starting tunnel now") + LOG.info("All settings we need are set by the user, starting tunnel now") // Setting tunnel settings setTunnelSettings { error in @@ -203,18 +205,18 @@ final class PacketTunnelProviderProxy: PacketTunnelProviderProxyProtocol { return } - Logger.logInfo("(PacketTunnelProviderProxy) - updateTunnelSettings; Upstreams or fallbacks are not set by the user. Get system DNS now") + LOG.info("Upstreams or fallbacks are not set by the user. Get system DNS now") // Setting empty settings to read system DNS servers // If we don't set them we wil be unable to read system DNS servers // and will be reading servers that we did set previously delegate?.setTunnelSettings(nil) { error in if let error = error { - Logger.logError("(PacketTunnelProviderProxy) - updateTunnelSettings; Error setting empty settings; Error: \(error)") + LOG.error("Error setting empty settings; Error: \(error)") onSettingsUpdated(.error(error)) return } else { - Logger.logInfo("(PacketTunnelProviderProxy) - updateTunnelSettings; Successfully set empty settings") + LOG.info("Successfully set empty settings") } // https://github.com/AdguardTeam/AdguardForiOS/issues/1499 @@ -242,7 +244,7 @@ final class PacketTunnelProviderProxy: PacketTunnelProviderProxyProtocol { private func setTunnelSettings(_ onSettingsSet: @escaping (Error?) -> Void) { // Get tunnel mode user did select let tunnelMode = dnsConfiguration.lowLevelConfiguration.tunnelMode - Logger.logInfo("(PacketTunnelProviderProxy) - setTunnelSettings; Start with tunnelMode=\(tunnelMode)") + LOG.info("Start with tunnelMode=\(tunnelMode)") let full = tunnelMode != .split let withoutIcon = tunnelMode == .fullWithoutVpnIcon @@ -253,9 +255,9 @@ final class PacketTunnelProviderProxy: PacketTunnelProviderProxyProtocol { // Tell tunnel to set new tunnel settings delegate?.setTunnelSettings(tunnelSettings) { error in if let error = error { - Logger.logError("(PacketTunnelProviderProxy) - setTunnelSettings; Error setting settings=\(tunnelSettings); Error: \(error)") + LOG.error("Error setting settings=\(tunnelSettings); Error: \(error)") } else { - Logger.logInfo("(PacketTunnelProviderProxy) - setTunnelSettings; Successfully set settings=\(tunnelSettings)") + LOG.info("Successfully set settings=\(tunnelSettings)") } onSettingsSet(error) } @@ -273,14 +275,15 @@ final class PacketTunnelProviderProxy: PacketTunnelProviderProxyProtocol { AGLogger.setCallback { level, msg, length in guard let msg = msg else { return } let data = Data(bytes: msg, count: Int(length)) + let label = "DnsLibs-Tunnel" if let str = String(data: data, encoding: .utf8) { switch (level) { case AGLogLevel.AGLL_INFO: - Logger.logInfo("(DnsLibs) - \(str)") + LoggerWrapper.info(label, str) case AGLogLevel.AGLL_ERR, AGLogLevel.AGLL_WARN: - Logger.logError("(DnsLibs) - \(str)") + LoggerWrapper.error(label, str) default: - Logger.logDebug("(DnsLibs) - \(str)") + LoggerWrapper.debug(label, str) } } } diff --git a/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/PacketTunnelSettingsProvider.swift b/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/PacketTunnelSettingsProvider.swift index db41fb598..71e9bc466 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/PacketTunnelSettingsProvider.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/PacketTunnelProvider/PacketTunnelSettingsProvider.swift @@ -23,6 +23,8 @@ protocol PacketTunnelSettingsProviderProtocol { func createSettings(full: Bool, withoutVpnIcon: Bool) -> NEPacketTunnelNetworkSettings } +private let LOG = LoggerFactory.getLoggerWrapper(PacketTunnelSettingsProvider.self) + /// This object creates `NEPacketTunnelNetworkSettings` for `PacketTunnelProvider` /// Used to incapsulate settings creation logic final class PacketTunnelSettingsProvider: PacketTunnelSettingsProviderProtocol { @@ -41,7 +43,7 @@ final class PacketTunnelSettingsProvider: PacketTunnelSettingsProviderProtocol { let ipv4Available = networkUtils.isIpv4Available let ipv6Available = networkUtils.isIpv6Available - Logger.logInfo("Create tunnel settings. ipv4: \(ipv4Available ? "true": "false") ipv6: \(ipv6Available ? "true": "false")") + LOG.info("Create tunnel settings. ipv4: \(ipv4Available ? "true": "false") ipv6: \(ipv6Available ? "true": "false")") let localDnsAddress = ipv4Available ? addresses.localDnsIpv4 : addresses.localDnsIpv6 let dns = NEDNSSettings(servers: [localDnsAddress]) diff --git a/AdGuardSDK/AdGuardSDK/DNS/Statistics/ActivityStatistics/ActivityStatistics+Compress.swift b/AdGuardSDK/AdGuardSDK/DNS/Statistics/ActivityStatistics/ActivityStatistics+Compress.swift index bc68011d6..81d98b933 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/Statistics/ActivityStatistics/ActivityStatistics+Compress.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/Statistics/ActivityStatistics/ActivityStatistics+Compress.swift @@ -19,6 +19,8 @@ import SQLite import SharedAdGuardSDK +private let LOG = LoggerFactory.getLoggerWrapper(ActivityStatistics.self) + /// Extension with table compression methods /// These methods are not part of Interface, do not use them directly extension ActivityStatistics { @@ -26,20 +28,20 @@ extension ActivityStatistics { /// Compresses the table func compressTable() throws { try statisticsDb.transaction(.immediate) { - Logger.logInfo("(ActivityStatistics) - compressTable; Trying to compress the table") + LOG.info("Trying to compress the table") let recordsCountBeforeCompression = try statisticsDb.scalar(ActivityStatisticsTable.table.count) let compressedRecords = try getCompressedRecords() guard compressedRecords.count != recordsCountBeforeCompression else { - Logger.logInfo("(ActivityStatistics) - compressTable; No need to compress statistics") + LOG.info("No need to compress statistics") return } try reset() try add(records: compressedRecords) - Logger.logInfo("(ActivityStatistics) - compressTable; Successfully compressed the table; from \(recordsCountBeforeCompression) to \(compressedRecords.count)") + LOG.info("Successfully compressed the table; from \(recordsCountBeforeCompression) to \(compressedRecords.count)") } } @@ -49,7 +51,7 @@ extension ActivityStatistics { return } - Logger.logInfo("(ActivityStatistics) - adding \(records.count) records") + LOG.info("Adding \(records.count) records") // Use chunks of smaller size to call insertMany in order to avoid exceeding NEPacketTunnelProvider's // memory limit. See here for details: https://github.com/AdguardTeam/AdguardForiOS/issues/1935 @@ -71,7 +73,7 @@ extension ActivityStatistics { try statisticsDb.run(addQuery) } - Logger.logInfo("(ActivityStatistics) - finished adding records") + LOG.info("Finished adding records") } private func getCompressedRecords() throws -> [ActivityStatisticsRecord] { diff --git a/AdGuardSDK/AdGuardSDK/DNS/Statistics/ActivityStatistics/ActivityStatistics.swift b/AdGuardSDK/AdGuardSDK/DNS/Statistics/ActivityStatistics/ActivityStatistics.swift index c865caadb..65012c016 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/Statistics/ActivityStatistics/ActivityStatistics.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/Statistics/ActivityStatistics/ActivityStatistics.swift @@ -39,6 +39,8 @@ public protocol ActivityStatisticsProtocol: ResetableSyncProtocol { func getCounters(for period: StatisticsPeriod) throws -> CountersStatisticsRecord } +private let LOG = LoggerFactory.getLoggerWrapper(ActivityStatistics.self) + /// This object is responsible for counters statistics /// It stores and manages data for counters /// If data appears to be big it can compress it @@ -52,14 +54,14 @@ final public class ActivityStatistics: ActivityStatisticsProtocol { - Parameter readOnly: if true, we won't try to create and compress the database on the service init. Default value is false. This flag is needed when this service is used for read-only purposes (for instance, in a Widget). */ public init(statisticsDbContainerUrl: URL, readOnly: Bool = false) throws { - Logger.logInfo("(ActivityStatistics) - init start") + LOG.info("Init start") // Create directory if doesn't exist try FileManager.default.createDirectory(at: statisticsDbContainerUrl, withIntermediateDirectories: true, attributes: [:]) let dbName = Constants.Statistics.StatisticsType.activity.dbFileName self.statisticsDb = try Connection(statisticsDbContainerUrl.appendingPathComponent(dbName).path) - Logger.logInfo("(ActivityStatistics) - connected to \(dbName)") + LOG.info("Connected to \(dbName)") // TODO: - It's a crutch; Refactor it later // This database is used by several threads/processes at the same time. @@ -77,7 +79,7 @@ final public class ActivityStatistics: ActivityStatisticsProtocol { try? compressTable() } - Logger.logInfo("(ActivityStatistics) - init end") + LOG.info("Init end") } // MARK: - Public methods @@ -86,7 +88,7 @@ final public class ActivityStatistics: ActivityStatisticsProtocol { do { try add(record: record) } catch { - Logger.logError("(ActivityStatistics) - processRecord; Error adding record to DB; Error: \(error)") + LOG.error("Error adding record to DB; Error: \(error)") } } @@ -97,7 +99,7 @@ final public class ActivityStatistics: ActivityStatisticsProtocol { In case `timeStamp`s are equal will sort by `domain` */ func getRecords(for period: StatisticsPeriod) throws -> [ActivityStatisticsRecord] { - Logger.logDebug("(ActivityStatistics) - getRecords for period=\(period.debugDescription)") + LOG.debug("getRecords for period=\(period.debugDescription)") let interval = period.interval let query = ActivityStatisticsTable.table @@ -107,13 +109,13 @@ final public class ActivityStatistics: ActivityStatisticsProtocol { return ActivityStatisticsRecord(dbRecord: $0) } - Logger.logDebug("(ActivityStatistics) - getRecords; Return \(records.count) records for period=\(period.debugDescription)") + LOG.debug("Return \(records.count) records for period=\(period.debugDescription)") return records } public func getDomains(for period: StatisticsPeriod) throws -> [DomainsStatisticsRecord] { - Logger.logDebug("(ActivityStatistics) - getDomains for period=\(period.debugDescription)") + LOG.debug("getDomains for period=\(period.debugDescription)") let interval = period.interval let query = ActivityStatisticsTable.table @@ -128,12 +130,12 @@ final public class ActivityStatistics: ActivityStatisticsProtocol { let result = try statisticsDb.prepare(query.asSQL()).map { DomainsStatisticsRecord(dbRecord: $0) } - Logger.logDebug("(ActivityStatistics) - getDomains; Return \(result.count) domains for period=\(period.debugDescription)") + LOG.debug("Return \(result.count) domains for period=\(period.debugDescription)") return result } public func getCounters(for period: StatisticsPeriod) throws -> CountersStatisticsRecord { - Logger.logDebug("(ActivityStatistics) - getCounters for period=\(period.debugDescription)") + LOG.debug("getCounters for period=\(period.debugDescription)") let interval = period.interval let query = ActivityStatisticsTable.table @@ -147,25 +149,25 @@ final public class ActivityStatistics: ActivityStatisticsProtocol { let records = try statisticsDb.prepare(query.asSQL()).map { CountersStatisticsRecord(dbRecord: $0) } if records.count == 1 { - Logger.logDebug("(ActivityStatistics) - getCounters; Return \(records.first!) for period=\(period.debugDescription)") + LOG.debug("Return \(records.first!) for period=\(period.debugDescription)") return records.first! } else { - Logger.logDebug("(ActivityStatistics) - getCounters; Return zero CountersStatisticsRecord for period=\(period.debugDescription)") + LOG.debug("Return zero CountersStatisticsRecord for period=\(period.debugDescription)") return CountersStatisticsRecord.emptyRecord() } } public func reset() throws { - Logger.logInfo("(ActivityStatistics) - reset called") + LOG.info("Reset called") let resetQuery = ActivityStatisticsTable.table.delete() try statisticsDb.run(resetQuery) - Logger.logInfo("(ActivityStatistics) - reset successfully finished") + LOG.info("Reset successfully finished") } func add(record: ActivityStatisticsRecord) throws { - Logger.logDebug("(ActivityStatistics) - adding a record for \(record.domain)") + LOG.debug("Adding a record for \(record.domain)") let setters: [Setter] = [ActivityStatisticsTable.timeStamp <- record.timeStamp, ActivityStatisticsTable.domain <- record.domain, @@ -177,14 +179,14 @@ final public class ActivityStatistics: ActivityStatisticsProtocol { let addQuery = ActivityStatisticsTable.table.insert(setters) try statisticsDb.run(addQuery) - Logger.logDebug("(ActivityStatistics) - record for \(record.domain) has been added") + LOG.debug("Record for \(record.domain) has been added") } // MARK: - Private methods /// Creates `activity_statistics_table` in statistics DB if it doesn't exist private func createTableIfNotExists() throws { - Logger.logInfo("(ActivityStatistics) - create the statistics table if it does not exist") + LOG.info("Сreate the statistics table if it does not exist") let query = ActivityStatisticsTable.table.create(temporary: false, ifNotExists: true) { builder in builder.column(ActivityStatisticsTable.timeStamp) @@ -196,6 +198,6 @@ final public class ActivityStatistics: ActivityStatisticsProtocol { } try statisticsDb.run(query) - Logger.logInfo("(ActivityStatistics) - statistics table has been created") + LOG.info("Statistics table has been created") } } diff --git a/AdGuardSDK/AdGuardSDK/DNS/Statistics/ChartStatistics/ChartStatistics+Compress.swift b/AdGuardSDK/AdGuardSDK/DNS/Statistics/ChartStatistics/ChartStatistics+Compress.swift index a11d7d4ed..b614d4b9b 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/Statistics/ChartStatistics/ChartStatistics+Compress.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/Statistics/ChartStatistics/ChartStatistics+Compress.swift @@ -19,12 +19,14 @@ import SQLite import SharedAdGuardSDK +private let LOG = LoggerFactory.getLoggerWrapper(ChartStatistics.self) + extension ChartStatistics { /// Compresses table if there are more than 1000 records func compressTableIfNeeded() throws { let recordsCount = try statisticsDb.scalar(ChartStatisticsTable.table.count) if recordsCount >= 1000 { - Logger.logInfo("(ChartStatistics) - compressTableIfNeeded; Number of records is greater 1500, compress now") + LOG.info("Number of records is greater 1500, compress now") // Ignoring the error here since compressing the table is not a crucial operation. try? compressTable() @@ -32,14 +34,14 @@ extension ChartStatistics { } func compressTable() throws { - Logger.logInfo("(ChartStatistics) - compressTable; Trying to compress the table") + LOG.info("Trying to compress the table") let recordsCountBeforeCompression = try statisticsDb.scalar(ChartStatisticsTable.table.count) let compressedRecords = try getCompressedRecords() try reset() try compressedRecords.forEach { try add(record: $0) } - Logger.logInfo("(ChartStatistics) - compressTable; Successfully compressed the table; from \(recordsCountBeforeCompression) to \(compressedRecords.count)") + LOG.info("Successfully compressed the table; from \(recordsCountBeforeCompression) to \(compressedRecords.count)") } /// Returns specified `intervalsCount` number of date intervals for specified `period` diff --git a/AdGuardSDK/AdGuardSDK/DNS/Statistics/ChartStatistics/ChartStatistics.swift b/AdGuardSDK/AdGuardSDK/DNS/Statistics/ChartStatistics/ChartStatistics.swift index d3f4aa672..c8a8d4405 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/Statistics/ChartStatistics/ChartStatistics.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/Statistics/ChartStatistics/ChartStatistics.swift @@ -41,6 +41,8 @@ public protocol ChartStatisticsProtocol: ResetableSyncProtocol { func getPoints(for chartType: ChartType, for period: StatisticsPeriod, pointsCount: Int) throws -> ChartRecords } +private let LOG = LoggerFactory.getLoggerWrapper(ChartStatistics.self) + /// This object is responsible for managing statistics that is used to build charts final public class ChartStatistics: ChartStatisticsProtocol { @@ -92,7 +94,7 @@ final public class ChartStatistics: ChartStatisticsProtocol { try add(record: record) try compressTableIfNeeded() } catch { - Logger.logError("(ChartStatistics) - processRecord; Error adding record to DB; Error: \(error)") + LOG.error("Error adding record to DB; Error: \(error)") } } @@ -102,7 +104,7 @@ final public class ChartStatistics: ChartStatisticsProtocol { This method will return records sorted by `timeStamp` in ascending order */ func getRecords(for period: StatisticsPeriod) throws -> [ChartStatisticsRecord] { - Logger.logDebug("(ChartStatistics) - getRecords for period=\(period.debugDescription)") + LOG.debug("getRecords for period=\(period.debugDescription)") let interval = period.interval let query = ChartStatisticsTable.table @@ -112,13 +114,13 @@ final public class ChartStatistics: ChartStatisticsProtocol { ChartStatisticsRecord(dbRecord: $0) } - Logger.logDebug("(ChartStatistics) - getRecords; Return \(records.count) records for period=\(period.debugDescription)") + LOG.debug("Return \(records.count) records for period=\(period.debugDescription)") return records } public func getPoints(for chartType: ChartType, for period: StatisticsPeriod, pointsCount: Int) throws -> ChartRecords { - Logger.logDebug("(ChartStatistics) - getPoints for chartType=\(chartType) for period=\(period.debugDescription)") + LOG.debug("getPoints for chartType=\(chartType) for period=\(period.debugDescription)") /// Intervals for points. Each interval will contain 1 aggregated point let intervals = chartIntervals(for: period, intervalsCount: pointsCount) @@ -148,18 +150,18 @@ final public class ChartStatistics: ChartStatisticsProtocol { } } - Logger.logDebug("(ChartStatistics) - getPoints for chartType=\(chartType) for period=\(period.debugDescription) returning \(points.count) points") + LOG.debug("getPoints for chartType=\(chartType) for period=\(period.debugDescription) returning \(points.count) points") return ChartRecords(chartType: chartType, points: points) } /// Removes all records from the table public func reset() throws { - Logger.logInfo("(ChartStatistics) - reset called") + LOG.info("Reset called") let resetQuery = ChartStatisticsTable.table.delete() try statisticsDb.run(resetQuery) - Logger.logInfo("(ChartStatistics) - reset successfully finished") + LOG.info("Reset successfully finished") } // MARK: - Private methods diff --git a/AdGuardSDK/AdGuardSDK/DNS/Statistics/DnsLogStatistics/DnsLogStatistics.swift b/AdGuardSDK/AdGuardSDK/DNS/Statistics/DnsLogStatistics/DnsLogStatistics.swift index 960395ce0..b0f2cea4f 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/Statistics/DnsLogStatistics/DnsLogStatistics.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/Statistics/DnsLogStatistics/DnsLogStatistics.swift @@ -42,6 +42,8 @@ public protocol DnsLogStatisticsProtocol: ResetableSyncProtocol { func getAllowlistedDnsLogRecords(for period: StatisticsPeriod) throws -> [DnsRequestProcessedEvent] } +private let LOG = LoggerFactory.getLoggerWrapper(DnsLogStatistics.self) + /// This object is responsible for saving and getting statistics about DNS requests and responses /// It stores the last 1500 objects of log, if it is overflowed that it will purge the oldest 500 records final public class DnsLogStatistics: DnsLogStatisticsProtocol { @@ -56,7 +58,7 @@ final public class DnsLogStatistics: DnsLogStatisticsProtocol { let dbName = Constants.Statistics.StatisticsType.dnsLog.dbFileName statisticsDb = try Connection(statisticsDbContainerUrl.appendingPathComponent(dbName).path) - + // TODO: - It's a crutch; Refactor it later // This database is used by several threads at the same time. // It is possible that a database file is temporarily locked in one thread and is being accessed from another. @@ -75,28 +77,28 @@ final public class DnsLogStatistics: DnsLogStatisticsProtocol { try add(record: event) try purgeDnsLogIfNeeded() } catch { - Logger.logError("(DnsLogStatistics) - processEvent; Error adding event to DB; Error: \(error)") + LOG.error("Error adding event to DB; Error: \(error)") } } // TODO: - Needs new tests /// Returns all available records from `DNS_log_statistics.db` for the specified `period` public func getDnsLogRecords(for period: StatisticsPeriod) throws -> [DnsRequestProcessedEvent] { - Logger.logInfo("(DnsLogStatistics) - getDnsLogRecords called") + LOG.info("getDnsLogRecords called") let query = DnsLogTable.table .where(period.interval.start...period.interval.end ~= DnsLogTable.startDate) .order(DnsLogTable.startDate.desc) let all: [DnsRequestProcessedEvent] = try statisticsDb.prepare(query).map { DnsRequestProcessedEvent(dbLogRecord: $0) } - Logger.logInfo("(DnsLogStatistics) - getDnsLogRecords fetched \(all.count) log records") + LOG.info("getDnsLogRecords fetched \(all.count) log records") return all } // TODO: - Needs new tests /// Returns all available blocked records from `DNS_log_statistics.db` for the specified `period` public func getBlockedDnsLogRecords(for period: StatisticsPeriod) throws -> [DnsRequestProcessedEvent] { - Logger.logInfo("(DnsLogStatistics) - getBlockedDnsLogRecords called") + LOG.info("getBlockedDnsLogRecords called") let query = DnsLogTable.table .where( period.interval.start...period.interval.end ~= DnsLogTable.startDate && ( @@ -109,14 +111,14 @@ final public class DnsLogStatistics: DnsLogStatisticsProtocol { let blocked: [DnsRequestProcessedEvent] = try statisticsDb.prepare(query).map { DnsRequestProcessedEvent(dbLogRecord: $0) } - Logger.logInfo("(DnsLogStatistics) - getBlockedDnsLogRecords fetched \(blocked.count) log records") + LOG.info("getBlockedDnsLogRecords fetched \(blocked.count) log records") return blocked } // TODO: - Needs new tests /// Returns all available allowlisted records from `DNS_log_statistics.db` for the specified `period` public func getAllowlistedDnsLogRecords(for period: StatisticsPeriod) throws -> [DnsRequestProcessedEvent] { - Logger.logInfo("(DnsLogStatistics) - getAllowlistedDnsLogRecords called") + LOG.info("getAllowlistedDnsLogRecords called") let query = DnsLogTable.table .where( period.interval.start...period.interval.end ~= DnsLogTable.startDate && ( @@ -128,18 +130,18 @@ final public class DnsLogStatistics: DnsLogStatisticsProtocol { let allowlisted: [DnsRequestProcessedEvent] = try statisticsDb.prepare(query).map { DnsRequestProcessedEvent(dbLogRecord: $0) } - Logger.logInfo("(DnsLogStatistics) - getAllowlistedDnsLogRecords fetched \(allowlisted.count) log records") + LOG.info("getAllowlistedDnsLogRecords fetched \(allowlisted.count) log records") return allowlisted } /// Removes all records from `DNS_log_statistics.db` public func reset() throws { - Logger.logInfo("(DnsLogStatistics) - reset called") + LOG.info("Reset called") let resetQuery = DnsLogTable.table.delete() try statisticsDb.run(resetQuery) - Logger.logInfo("(DnsLogStatistics) - reset successfully finished") + LOG.info("Reset successfully finished") } // MARK: - Private methods @@ -176,7 +178,7 @@ final public class DnsLogStatistics: DnsLogStatisticsProtocol { let recordsToRemoveCount = 500 try removeLast(recordsToRemoveCount) - Logger.logInfo("(DnsLogStatistics) - purgeDnsLogIfNeeded; Last \(recordsToRemoveCount) records were purged") + LOG.info("Last \(recordsToRemoveCount) records were purged") } /// Removes `n` last rows from the table diff --git a/AdGuardSDK/AdGuardSDK/DNS/Statistics/DnsRequestProcessedEventHandler.swift b/AdGuardSDK/AdGuardSDK/DNS/Statistics/DnsRequestProcessedEventHandler.swift index 91bd883f1..92775c744 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/Statistics/DnsRequestProcessedEventHandler.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/Statistics/DnsRequestProcessedEventHandler.swift @@ -23,6 +23,8 @@ protocol DnsRequestProcessedEventHandlerProtocol: AnyObject { func handle(event: AGDnsRequestProcessedEventWrapper) } +private let LOG = LoggerFactory.getLoggerWrapper(DnsRequestProcessedEventHandler.self) + /// This object is used in Tunnel to save statistics data obtained from DNS-libs final class DnsRequestProcessedEventHandler: DnsRequestProcessedEventHandlerProtocol { @@ -50,11 +52,11 @@ final class DnsRequestProcessedEventHandler: DnsRequestProcessedEventHandlerProt func handle(event: AGDnsRequestProcessedEventWrapper) { eventQueue.async { [weak self] in guard let self = self, event.error == nil else { - Logger.logError("(DnsRequestProcessedEventHandler) - handleEvent; Error: \(event.error ?? "Missing self")") + LOG.error("Error: \(event.error ?? "Missing self")") return } - Logger.logInfo("handleEvent domain: \(event.domain) answer: \(event.answer) status: \(event.status) rules: \(event.rules) type: \(event.type) whitelst: \(event.whitelist) upstreamId: \(event.upstreamId ?? 0)") + LOG.info("handleEvent domain: \(event.domain) answer: \(event.answer) status: \(event.status) rules: \(event.rules) type: \(event.type) whitelst: \(event.whitelist) upstreamId: \(event.upstreamId ?? 0)") let activeDnsUpstream: DnsProxyUpstream? diff --git a/AdGuardSDK/AdGuardSDK/DNS/Utils/NetworkUtils.swift b/AdGuardSDK/AdGuardSDK/DNS/Utils/NetworkUtils.swift index 4489be0b2..656d3eeb1 100644 --- a/AdGuardSDK/AdGuardSDK/DNS/Utils/NetworkUtils.swift +++ b/AdGuardSDK/AdGuardSDK/DNS/Utils/NetworkUtils.swift @@ -38,6 +38,8 @@ public protocol NetworkUtilsProtocol { func upstreamIsValid(_ upstream: String) -> Bool } +private let LOG = LoggerFactory.getLoggerWrapper(NetworkUtils.self) + public class NetworkUtils: NetworkUtilsProtocol { // We cannot use the @available attribute on properties. Therefore, we have to use a function to get it. @@ -53,26 +55,26 @@ public class NetworkUtils: NetworkUtilsProtocol { var group: DispatchGroup? = DispatchGroup() group?.enter() monitor().pathUpdateHandler = { newPath in - Logger.logInfo("(NetworkUtils) - NWPathMonitor received the current path update") - Logger.logInfo("(NetworkUtils) - path status: \(newPath.status)") - Logger.logInfo("(NetworkUtils) - path debugDescription: \(newPath.debugDescription)") - Logger.logInfo("(NetworkUtils) - path supportsIPv4: \(newPath.supportsIPv4)") - Logger.logInfo("(NetworkUtils) - path supportsIPv6: \(newPath.supportsIPv6)") + LOG.info("NWPathMonitor received the current path update") + LOG.info("Path status: \(newPath.status)") + LOG.info("Path debugDescription: \(newPath.debugDescription)") + LOG.info("Path supportsIPv4: \(newPath.supportsIPv4)") + LOG.info("Path supportsIPv6: \(newPath.supportsIPv6)") for gateway in newPath.gateways { - Logger.logInfo("(NetworkUtils) - gateway: \(gateway.debugDescription)") + LOG.info("gateway: \(gateway.debugDescription)") } for interface in newPath.availableInterfaces { - Logger.logInfo("(NetworkUtils) - interface: [\(interface.index)] \(interface.name)") - Logger.logInfo("(NetworkUtils) - interface debugDescription: \(interface.debugDescription)") - Logger.logInfo("(NetworkUtils) - interface type: \(interface.type)") + LOG.info("Interface: [\(interface.index)] \(interface.name)") + LOG.info("Interface debugDescription: \(interface.debugDescription)") + LOG.info("Interface type: \(interface.type)") } group?.leave() group = nil } - Logger.logInfo("(NetworkUtils) - NWPathMonitor start") + LOG.info("NWPathMonitor start") // We must start the monitor to have the actual value of the path at any time monitor().start(queue: DispatchQueue(label: "NWPathMonitor handler queue")) @@ -171,7 +173,7 @@ public class NetworkUtils: NetworkUtilsProtocol { let dnsUpstream = AGDnsUpstream(address: upstream, bootstrap: bootstraps, timeoutMs: AGDnsUpstream.defaultTimeoutMs, serverIp: Data(), id: 0, outboundInterfaceName: nil) if let error = AGDnsUtils.test(dnsUpstream, ipv6Available: isIpv6Available, offline: false) { - Logger.logError("(NetworkUtils) - upstreamIsValid; Error: \(error)") + LOG.error("upstreamIsValid; Error: \(error)") return false } else { return true diff --git a/AdGuardSDK/AdGuardSDK/Safari/ApiMethods/Parsers/FiltersLocalizationsParser.swift b/AdGuardSDK/AdGuardSDK/Safari/ApiMethods/Parsers/FiltersLocalizationsParser.swift index 87cfd7521..db2bbd451 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/ApiMethods/Parsers/FiltersLocalizationsParser.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/ApiMethods/Parsers/FiltersLocalizationsParser.swift @@ -18,13 +18,15 @@ import SharedAdGuardSDK +private let LOG = LoggerFactory.getLoggerWrapper(FiltersLocalizationsParser.self) + /// Parser to parse data from `FiltersLocalizationsRequest` and returns `ExtendedFiltersMetaLocalizations` struct FiltersLocalizationsParser: ParserProtocol { typealias Model = ExtendedFiltersMetaLocalizations func parse(data: Data, response: URLResponse?) -> Model? { guard let response = response as? HTTPURLResponse, response.statusCode == 200 else { - Logger.logError("(FiltersLocalizationsParser) bad response") + LOG.error("Bad response") return nil } diff --git a/AdGuardSDK/AdGuardSDK/Safari/ApiMethods/Parsers/FiltersMetadataParser.swift b/AdGuardSDK/AdGuardSDK/Safari/ApiMethods/Parsers/FiltersMetadataParser.swift index 393f84814..127de4e15 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/ApiMethods/Parsers/FiltersMetadataParser.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/ApiMethods/Parsers/FiltersMetadataParser.swift @@ -18,13 +18,15 @@ import SharedAdGuardSDK +private let LOG = LoggerFactory.getLoggerWrapper(FiltersMetadataParser.self) + /// Parser to parse data from `FiltersMetadataRequest` and returns `ExtendedFiltersMeta` struct FiltersMetadataParser: ParserProtocol { typealias Model = ExtendedFiltersMeta func parse(data: Data, response: URLResponse?) -> Model? { guard let response = response as? HTTPURLResponse, response.statusCode == 200 else { - Logger.logError("(FiltersMetadataParser) bad response") + LOG.error("Bad response") return nil } diff --git a/AdGuardSDK/AdGuardSDK/Safari/ApiMethods/Requests/FiltersMetadataRequest.swift b/AdGuardSDK/AdGuardSDK/Safari/ApiMethods/Requests/FiltersMetadataRequest.swift index d41e9dd9f..82b667863 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/ApiMethods/Requests/FiltersMetadataRequest.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/ApiMethods/Requests/FiltersMetadataRequest.swift @@ -18,6 +18,8 @@ import SharedAdGuardSDK +private let LOG = LoggerFactory.getLoggerWrapper(FiltersMetadataRequest.self) + /// Request to obtain filters meta data struct FiltersMetadataRequest: RequestProtocol { @@ -48,7 +50,7 @@ struct FiltersMetadataRequest: RequestProtocol { guard let resultStr = params.constructLink(url: path), let resultUrl = URL(string: resultStr) else { - Logger.logError("FiltersMetadataRequest errror - can not construct url" ) + LOG.error("Error - can not construct url" ) return nil } diff --git a/AdGuardSDK/AdGuardSDK/Safari/ContentBlockers/ContentBlockerService.swift b/AdGuardSDK/AdGuardSDK/Safari/ContentBlockers/ContentBlockerService.swift index 85c70382c..193e6edbe 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/ContentBlockers/ContentBlockerService.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/ContentBlockers/ContentBlockerService.swift @@ -36,6 +36,8 @@ public protocol ContentBlockerServiceProtocol { func getState(for cbType: ContentBlockerType) -> Bool } +private let LOG = LoggerFactory.getLoggerWrapper(ContentBlockerService.self) + /* This class is responsible for updating Safari content blockers */ final public class ContentBlockerService: ContentBlockerServiceProtocol { @@ -79,13 +81,13 @@ final public class ContentBlockerService: ContentBlockerServiceProtocol { public func updateContentBlockers(onContentBlockersUpdated: @escaping (_ error: Error?) -> Void) { updateQueue.async { [weak self] in - Logger.logInfo("(ContentBlockerService) - updateContentBlockers; CBs update started") + LOG.info("CBs update started") NotificationCenter.default.contentBlockersUpdateStarted() let updateError = self?.updateContentBlockersSync() NotificationCenter.default.contentBlockersUpdateFinished() - Logger.logInfo("(ContentBlockerService) - updateContentBlockers; CBs update finished") + LOG.info("CBs update finished") onContentBlockersUpdated(updateError) } } @@ -100,7 +102,7 @@ final public class ContentBlockerService: ContentBlockerServiceProtocol { case .success(let enabled): isEnabled = enabled case .error(let error): - Logger.logError("(ContentBlockerService) - getState; Failed to reveal CB state, suppose it is disabled; Error: \(error)") + LOG.error("Failed to reveal CB state, suppose it is disabled; Error: \(error)") } group.leave() } @@ -154,14 +156,14 @@ final public class ContentBlockerService: ContentBlockerServiceProtocol { // Try to reload content blocker contentBlockersManager.reloadContentBlocker(withId: cbBundleId) { [weak self] error in guard let self = self else { - Logger.logError("(ContentBlockerService) - reloadContentBlocker; сontentBlockersManager.reloadContentBlocker self is missing!") + LOG.error("сontentBlockersManager.reloadContentBlocker self is missing!") onContentBlockerReloaded(CommonError.missingSelf) NotificationCenter.default.standaloneContentBlockerUpdateFinished(cbType) return } if let userInfo = (error as NSError?)?.userInfo { - Logger.logError("(ContentBlockerService) - reloadContentBlocker; Error reloading content blocker; Error: \(userInfo)") + LOG.error("Error reloading content blocker; Error: \(userInfo)") // Sometimes Safari fails to register a content blocker because of inner race conditions, so we try to reload it second time if firstTry { // Do not notify when CB finished to reload if it was first try and there will be second reload diff --git a/AdGuardSDK/AdGuardSDK/Safari/ContentBlockers/ContentBlockersInfoStorage.swift b/AdGuardSDK/AdGuardSDK/Safari/ContentBlockers/ContentBlockersInfoStorage.swift index 9ae8f37de..9ebf633c1 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/ContentBlockers/ContentBlockersInfoStorage.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/ContentBlockers/ContentBlockersInfoStorage.swift @@ -90,6 +90,8 @@ protocol ContentBlockersInfoStorageProtocol: ResetableSyncProtocol { func getJsonUrl(for cbType: ContentBlockerType) -> URL } +private let LOG = LoggerFactory.getLoggerWrapper(ContentBlockersInfoStorage.self) + /* This class is responsible for managing JSON files for every content blocker */ final class ContentBlockersInfoStorage: ContentBlockersInfoStorageProtocol { @@ -127,7 +129,7 @@ final class ContentBlockersInfoStorage: ContentBlockersInfoStorageProtocol { throw CommonError.error(message: "Received \(converterResults.count) results, but expecting \(ContentBlockerType.allCases.count)") } - Logger.logInfo("(ContentBlockersInfoStorage) - save cbJsons; Trying to save \(converterResults.count) jsons") + LOG.info("Trying to save \(converterResults.count) jsons") let result: [ConverterResult] = try converterResults.map { let urlToSave = getJsonUrl(for: $0.type) @@ -139,13 +141,13 @@ final class ContentBlockersInfoStorage: ContentBlockersInfoStorageProtocol { } func getConverterResult(for cbType: ContentBlockerType) -> ConverterResult? { - Logger.logInfo("(ContentBlockersInfoStorage) - getConverterResult; Result request for \(cbType)") + LOG.info("Result request for \(cbType)") let allResults = userDefaultsStorage.allCbInfo return allResults.first(where: { $0.type == cbType }) } func reset() throws { - Logger.logInfo("(ContentBlockersInfoStorage) - reset start") + LOG.info("Reset start") // Remove all converted JSON fils try fileManager.removeItem(at: jsonStorageUrl) @@ -156,7 +158,7 @@ final class ContentBlockersInfoStorage: ContentBlockersInfoStorageProtocol { // Clear user defaults userDefaultsStorage.allCbInfo = [] - Logger.logInfo("(ContentBlockersInfoStorage) - reset; Successfully deleted directory with CBs JSONs") + LOG.info("Successfully deleted directory with CBs JSONs") } func getJsonUrl(for cbType: ContentBlockerType) -> URL { @@ -166,7 +168,7 @@ final class ContentBlockersInfoStorage: ContentBlockersInfoStorageProtocol { // MARK: - Private methods private func saveAdvancedRules(from results: [FiltersConverterResult]) throws { - Logger.logInfo("(ContentBlockersInfoStorage) - saveAdvancedRules; start") + LOG.info("saveAdvancedRules; start") // Remove duplicates from the rules. // Note that we persist the rules order (it is very important for interpreting them in the Web Extension). @@ -187,7 +189,7 @@ final class ContentBlockersInfoStorage: ContentBlockersInfoStorageProtocol { try uniqueRulesText.write(to: advancedRulesFileUrl, atomically: true, encoding: .utf8) userDefaultsStorage.advancedRulesCount = rules.count - Logger.logInfo("(ContentBlockersInfoStorage) - saveAdvancedRules; finished saving \(rules.count) rules") + LOG.info("Finished saving \(rules.count) rules") } } diff --git a/AdGuardSDK/AdGuardSDK/Safari/FilterService/FiltersService.swift b/AdGuardSDK/AdGuardSDK/Safari/FilterService/FiltersService.swift index 4c05ba438..78c4c02ce 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/FilterService/FiltersService.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/FilterService/FiltersService.swift @@ -114,6 +114,8 @@ protocol FiltersServiceProtocol: ResetableAsyncProtocol { func reinitializeGroups() throws } +private let LOG = LoggerFactory.getLoggerWrapper(FiltersService.self) + /* This class is a proxy between filters, groups objects and SQLite database. It is used to get or modify filters objects. @@ -194,7 +196,7 @@ final class FiltersService: FiltersServiceProtocol { metaParser: CustomFilterMetaParserProtocol = CustomFilterMetaParser(), apiMethods: SafariProtectionApiMethodsProtocol) throws { - Logger.logInfo("(FiltersService) - init start") + LOG.info("Init start") self.configuration = configuration self.filterFilesStorage = filterFilesStorage @@ -205,7 +207,7 @@ final class FiltersService: FiltersServiceProtocol { try initGroups() - Logger.logInfo("(FiltersService) - init end") + LOG.info("Init end") } // MARK: - Public methods @@ -229,7 +231,7 @@ final class FiltersService: FiltersServiceProtocol { let now = Date().timeIntervalSince(self.userDefaultsStorage.lastFiltersUpdateCheckDate) if now < Self.updatePeriod && !forcibly { preconditionError = FilterServiceError.updatePeriodError(lastUpdateTime: Int(now / 3600)) - Logger.logError("(FiltersService) - Update period error: \(preconditionError!)") + LOG.error("Update period error: \(preconditionError!)") return } @@ -281,7 +283,7 @@ final class FiltersService: FiltersServiceProtocol { try self.initGroups() } catch { groupsUpdateError = error - Logger.logError("(FiltersService) - updateAllMeta; Localized groups fetching error: \(error)") + LOG.error("Localized groups fetching error: \(error)") } // Notify that filters finished updating @@ -314,13 +316,13 @@ final class FiltersService: FiltersServiceProtocol { try metaStorage.setGroup(withId: id, enabled: enabled) if let groupIndex = groupsAtomic.firstIndex(where: { $0.groupId == id }) { _groupsAtomic.mutate { $0[groupIndex].isEnabled = enabled } - Logger.logDebug("(FiltersService) - setGroup; Group with id=\(id) was successfully set to enabled=\(enabled)") + LOG.debug("Group with id=\(id) was successfully set to enabled=\(enabled)") } else { - Logger.logDebug("(FiltersService) - setGroup; Group with id=\(id) not exists") + LOG.debug("Group with id=\(id) not exists") throw FilterServiceError.nonExistingGroupId(groupId: id) } } catch { - Logger.logError("(FiltersService) - setGroup; Error setting group with id=\(id) to enabled=\(enabled): \(error)") + LOG.error("Error setting group with id=\(id) to enabled=\(enabled): \(error)") throw error } } @@ -334,14 +336,14 @@ final class FiltersService: FiltersServiceProtocol { let filterIndex = groupsAtomic[groupIndex].filters.firstIndex(where: { $0.filterId == id }) { _groupsAtomic.mutate { $0[groupIndex].filters[filterIndex].isEnabled = enabled } - Logger.logDebug("(FiltersService) - setFilter; Filter id=\(id); group id=\(groupId) was successfully set to enabled=\(enabled)") + LOG.debug("Filter id=\(id); group id=\(groupId) was successfully set to enabled=\(enabled)") } else { - Logger.logDebug("(FiltersService) - setFilter; Filter id=\(id) or group id=\(groupId) not exists") + LOG.debug("Filter id=\(id) or group id=\(groupId) not exists") throw FilterServiceError.nonExistingFilterId(filterId: id) } } catch { - Logger.logError("(FiltersService) - setFilter; Error setting filtrer with id=\(id); group id=\(groupId) to enabled=\(enabled): \(error)") + LOG.error("Error setting filtrer with id=\(id); group id=\(groupId) to enabled=\(enabled): \(error)") throw error } } @@ -354,7 +356,7 @@ final class FiltersService: FiltersServiceProtocol { let subscriptionUrl = URL(string: filterDownloadPage) else { let error = FilterServiceError.missedFilterDownloadPage(filterName: customFilter.name ?? "nil") - Logger.logError("(FiltersService) - add custom filter; \(error)") + LOG.error("Add custom filter; \(error)") DispatchQueue.main.async { onFilterAdded(error) } return } @@ -377,7 +379,7 @@ final class FiltersService: FiltersServiceProtocol { try self.metaStorage.add(filter: filterToAdd, enabled: enabled) } catch { - Logger.logError("(FiltersService) - add custom filter; Error while adding: \(error)") + LOG.error("Error occurred while adding custom filter: \(error)") self.completionQueue.async { onFilterAdded(error) } return } @@ -390,7 +392,7 @@ final class FiltersService: FiltersServiceProtocol { displayNumber: filterId) self._groupsAtomic.mutate { $0[customGroupIndex].filters.append(safariFilter) } - Logger.logInfo("(FiltersService) - add customFilter; Custom filter with id = \(filterId) was successfully added") + LOG.info("Custom filter with id = \(filterId) was successfully added") self.completionQueue.async { onFilterAdded(nil) } } } @@ -399,7 +401,7 @@ final class FiltersService: FiltersServiceProtocol { try workingQueue.sync { guard id >= CustomFilterMeta.baseCustomFilterId else { let error = FilterServiceError.invalidCustomFilterId(filterId: id) - Logger.logError("(FiltersService) - deleteCustomFilter; Invalid custom filter id: \(error)") + LOG.error("Invalid custom filter id: \(error)") throw error } try metaStorage.deleteFilter(withId: id) @@ -407,7 +409,7 @@ final class FiltersService: FiltersServiceProtocol { let customGroupIndex = groupsAtomic.firstIndex(where: { $0.groupType == .custom })! _groupsAtomic.mutate { $0[customGroupIndex].filters.removeAll(where: { $0.filterId == id }) } - Logger.logDebug("(FiltersService) - deleteCustomFilter; Custom filter with id = \(id) was successfully deleted") + LOG.debug("Custom filter with id = \(id) was successfully deleted") } } @@ -415,7 +417,7 @@ final class FiltersService: FiltersServiceProtocol { try workingQueue.sync { guard id >= CustomFilterMeta.baseCustomFilterId else { let error = FilterServiceError.invalidCustomFilterId(filterId: id) - Logger.logError("(FiltersService) - renameCustomFilter; Invalid custom filter id: \(error)") + LOG.error("Invalid custom filter id: \(error)") throw error } try metaStorage.renameFilter(withId: id, name: name) @@ -437,7 +439,7 @@ final class FiltersService: FiltersServiceProtocol { rulesCount: filter.rulesCount) _groupsAtomic.mutate { $0[customGroupIndex].filters[filterIndex] = newFilter } - Logger.logDebug("(FiltersService) - renameCustomFilter; Custom filter with id = \(id) was successfully renamed") + LOG.debug("Custom filter with id = \(id) was successfully renamed") } } @@ -450,7 +452,7 @@ final class FiltersService: FiltersServiceProtocol { /* Resets all data stored to default */ func reset(_ onResetFinished: @escaping (Error?) -> Void) { workingQueue.async { [weak self] in - Logger.logInfo("(FiltersService) - reset start") + LOG.info("Reset start") guard let self = self else { onResetFinished(CommonError.missingSelf) @@ -463,7 +465,7 @@ final class FiltersService: FiltersServiceProtocol { try self.filterFilesStorage.unzipPredefinedFiltersIfNeeded() } catch { - Logger.logInfo("(FiltersService) - reset; Error: \(error)") + LOG.info("Error: \(error)") onResetFinished(error) return } @@ -472,17 +474,17 @@ final class FiltersService: FiltersServiceProtocol { self.updateAllMeta(forcibly: true) { result in if case .error(let error) = result { - Logger.logError("(FiltersService) - reset; Error updating meta after reset; Error: \(error)") + LOG.error("Error updating meta after reset; Error: \(error)") } else { - Logger.logInfo("(FiltersService) - reset; Successfully reset all groups") + LOG.info("Successfully reset all groups") } do { try self.initGroups() - Logger.logInfo("(FiltersService) - reset; Successfully updated groups") + LOG.info("Successfully updated groups") } catch { - Logger.logError("(FiltersService) - reset; Error updating groups; Error: \(error)") + LOG.error("Error updating groups; Error: \(error)") onResetFinished(error) return } @@ -535,7 +537,7 @@ final class FiltersService: FiltersServiceProtocol { Than it saves all filter meta to the database */ private func add(filter: ExtendedFilterMetaProtocol, _ onFilterAdded: @escaping (_ error: Error?) -> Void) { - Logger.logInfo("(FiltersService) - addFilter; Received new filter with id=\(filter.filterId) from server, add it now") + LOG.info("Received new filter with id=\(filter.filterId) from server, add it now") filterFilesStorage.updateFilter(withId: filter.filterId) { [weak self] error in guard let self = self else { @@ -544,21 +546,21 @@ final class FiltersService: FiltersServiceProtocol { } if let error = error { - Logger.logError("(FiltersService) - addFilter; Content for filter with id=\(filter.filterId) wasn't loaded. Error: \(error)") + LOG.error("Content for filter with id=\(filter.filterId) wasn't loaded. Error: \(error)") onFilterAdded(error) return } - Logger.logInfo("(FiltersService) - addFilter; Content for filter with id=\(filter.filterId) was loaded and saved") + LOG.info("Content for filter with id=\(filter.filterId) was loaded and saved") do { try self.metaStorage.add(filter: filter, enabled: false) try self.metaStorage.updateAll(tags: filter.tags, forFilterWithId: filter.filterId) try self.metaStorage.updateAll(langs: filter.languages, forFilterWithId: filter.filterId) - Logger.logInfo("(FiltersService) - addFilter; Filter with id=\(filter.filterId) was added") + LOG.info("Filter with id=\(filter.filterId) was added") onFilterAdded(nil) } catch { - Logger.logError("(FiltersService) - addFilter; Meta for filter with id=\(filter.filterId) wasn't updated. Error: \(error)") + LOG.error("Meta for filter with id=\(filter.filterId) wasn't updated. Error: \(error)") onFilterAdded(error) return } @@ -570,7 +572,7 @@ final class FiltersService: FiltersServiceProtocol { - Returns ids of filters that were successfully added to our storage */ func add(filters: [ExtendedFilterMetaProtocol]) -> [Int] { - Logger.logInfo("(FiltersService) - addFilters; Trying to add \(filters.count) filters") + LOG.info("Trying to add \(filters.count) filters") @Atomic var addedFiltersIds: [Int] = [] @@ -579,7 +581,7 @@ final class FiltersService: FiltersServiceProtocol { group.enter() add(filter: filter) { error in if let error = error { - Logger.logError("(FiltersService) - addFilters; Filter with id=\(filter.filterId) wasn't added. Error: \(error)") + LOG.error("Filter with id=\(filter.filterId) wasn't added. Error: \(error)") } else { _addedFiltersIds.mutate { $0.append(filter.filterId) } } @@ -614,7 +616,7 @@ final class FiltersService: FiltersServiceProtocol { - Returns ids of filters that were successfully removed from our storage */ private func removeFilters(withIds ids: [Int]) -> [Int] { - Logger.logInfo("(FiltersService) - removeFilters; Trying to remove \(ids.count) filters") + LOG.info("Trying to remove \(ids.count) filters") var removedFiltersIds: [Int] = [] for id in ids { @@ -624,7 +626,7 @@ final class FiltersService: FiltersServiceProtocol { removedFiltersIds.append(id) } catch { - Logger.logError("(FiltersService) - removeFilters; Filter with id=\(id) wasn't removed. Error: \(error)") + LOG.error("Filter with id=\(id) wasn't removed. Error: \(error)") } } @@ -672,7 +674,7 @@ final class FiltersService: FiltersServiceProtocol { */ private func getRulesCountForFilter(withId id: Int) -> Int { guard let filterContent = filterFilesStorage.getFilterContentForFilter(withId: id) else { - Logger.logError("(FiltersService) - getRulesCountForFilter; received nil for filter with id=\(id)") + LOG.error("Received nil for filter with id=\(id)") return 0 } @@ -705,7 +707,7 @@ final class FiltersService: FiltersServiceProtocol { let customGroup = groupsAtomic.first(where: { $0.groupType == .custom }), customGroup.isEnabled else { - Logger.logInfo("(FiltersService) - updateCustomFilters; custom group is missing or disabled") + LOG.info("Custom group is missing or disabled") onCustomFiltersUpdated(([], [])) return } @@ -713,7 +715,7 @@ final class FiltersService: FiltersServiceProtocol { // Get enabled custom filters let enabledCustomFilters = customGroup.filters.filter { $0.isEnabled } if enabledCustomFilters.isEmpty { - Logger.logInfo("(FiltersService) - updateCustomFilters; There are 0 custom filters enabled") + LOG.info("There are 0 custom filters enabled") onCustomFiltersUpdated(([], [])) return } @@ -772,10 +774,10 @@ final class FiltersService: FiltersServiceProtocol { // Update custom filter meta let isUpdated = try metaStorage.update(filter: filter) - Logger.logInfo("(FiltersService) - updateCustomFilter; Custom filter with id=\(customFilter.filterId) was updated successfully=\(isUpdated)") + LOG.info("Custom filter with id=\(customFilter.filterId) was updated successfully=\(isUpdated)") return isUpdated } catch { - Logger.logError("(FiltersService) - updateCustomFilter; Error parsing new meta for custom filter with id=\(customFilter.filterId); Error: \(error)") + LOG.error("Error parsing new meta for custom filter with id=\(customFilter.filterId); Error: \(error)") return false } } @@ -806,10 +808,10 @@ final class FiltersService: FiltersServiceProtocol { // Update filter file updateFilterFileContent(filter: filter) { error in if let error = error { - Logger.logError("(FiltersService) - updateFiltersFileContent; Failed to download content of filter with id=\(filter.filterId); Error: \(error)") + LOG.error("Failed to download content of filter with id=\(filter.filterId); Error: \(error)") _failedFilterIds.mutate { $0.insert(filter.filterId) } } else { - Logger.logDebug("(FiltersService) - updateFiltersFileContent; Successfully downloaded content of filter with id=\(filter.filterId)") + LOG.debug("Successfully downloaded content of filter with id=\(filter.filterId)") _successfullyLoadedFilterIds.mutate { $0.insert(filter.filterId) } } group.leave() @@ -850,7 +852,7 @@ final class FiltersService: FiltersServiceProtocol { metaUpdateResult = try self.save(predefinedFiltersMeta: metaWithoutRestricted, filtersIdsToUpdate: ids) } catch { resultError = error - Logger.logError("(FiltersService) - Saving filters metadata error: \(error)") + LOG.error("Saving filters metadata error: \(error)") } } group.leave() @@ -867,7 +869,7 @@ final class FiltersService: FiltersServiceProtocol { try self.save(localizations: localizationsWithoutRestricted, filtersIdsToSave: ids) } catch { resultError = error - Logger.logError("(FiltersService) - Saving filters localizations error: \(error)") + LOG.error("Saving filters localizations error: \(error)") } } group.leave() @@ -972,7 +974,7 @@ final class FiltersService: FiltersServiceProtocol { guard let filterDownloadPage = filter.filterDownloadPage, let subscriptionUrl = URL(string: filterDownloadPage) else { - Logger.logError("(FiltersService) - updateCustomFilter; filterDownloadPage is missed for filter with id = \(filter.filterId)") + LOG.error("filterDownloadPage is missed for filter with id = \(filter.filterId)") onFilesUpdated(FilterServiceError.missedFilterDownloadPage(filterName: "\(filter.name ?? "nil") and filter id = \(filter.filterId))")) return } @@ -1011,7 +1013,7 @@ final class FiltersService: FiltersServiceProtocol { for filter in group.filters { guard isRecommended(filter: filter, currentLanguage: currentLanguage) else { continue } try metaStorage.setFilter(withId: filter.filterId, enabled: true) - Logger.logInfo("(FiltersService) - enablePredefinedMeta; Filter with id=\(filter.filterId) were enabled for groupType=\(group.groupType)") + LOG.info("Filter with id=\(filter.filterId) were enabled for groupType=\(group.groupType)") recommendedCount += 1 } @@ -1020,7 +1022,7 @@ final class FiltersService: FiltersServiceProtocol { */ let groupIsEnabled = recommendedCount > 0 && groupsToEnable.contains(group.groupType) try metaStorage.setGroup(withId: group.groupId, enabled: groupIsEnabled) - Logger.logInfo("(FiltersService) - enablePredefinedMeta; Group with groupType=\(group.groupType) were enabled = \(groupIsEnabled)") + LOG.info("Group with groupType=\(group.groupType) were enabled = \(groupIsEnabled)") } } @@ -1069,12 +1071,12 @@ fileprivate extension NSNotification.Name { fileprivate extension NotificationCenter { func filtersUpdateStarted() { self.post(name: .filtersUpdateStarted, object: self, userInfo: nil) - Logger.logDebug("(FiltersService) - filtersUpdateStarted; Notification filtersUpdateStarted posted") + LOG.debug("Notification filtersUpdateStarted posted") } func filtersUpdateFinished() { self.post(name: .filtersUpdateFinished, object: self, userInfo: nil) - Logger.logDebug("(FiltersService) - filtersUpdateFinished; Notification filtersUpdateFinished posted") + LOG.debug("Notification filtersUpdateFinished posted") } } diff --git a/AdGuardSDK/AdGuardSDK/Safari/FiltersConvertation/FiltersConverter.swift b/AdGuardSDK/AdGuardSDK/Safari/FiltersConvertation/FiltersConverter.swift index 49555b514..31a560004 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/FiltersConvertation/FiltersConverter.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/FiltersConvertation/FiltersConverter.swift @@ -78,6 +78,8 @@ protocol FiltersConverterProtocol { func convert(filters: [FilterFileContent], blocklistRules: [String]?, allowlistRules: [String]?, invertedAllowlistRules: [String]?) -> [FiltersConverterResult] } +private let LOG = LoggerFactory.getLoggerWrapper(FiltersConverter.self) + final class FiltersConverter: FiltersConverterProtocol { /** @@ -175,12 +177,12 @@ final class FiltersConverter: FiltersConverterProtocol { } private func convert(filters: [ContentBlockerType: [String]]) -> [FiltersConverterResult] { - Logger.logInfo("(FiltersConverter) - convertFilters; Safari rules conversion started") + LOG.info("Safari rules conversion started") let safariVersion = SafariVersion(rawValue: configuration.iosVersion) ?? .safari15 let conversionResult: [FiltersConverterResult] = filters.concurrentMap { [unowned self] cbType, rules -> FiltersConverterResult in - Logger.logInfo("(FiltersConverter) - convertFilters; Start converting \(cbType)") + LOG.info("Start converting \(cbType)") let converter = ContentBlockerConverterWrapper() let result = converter.convertArray( @@ -190,15 +192,15 @@ final class FiltersConverter: FiltersConverterProtocol { advancedBlocking: configuration.advancedBlockingIsEnabled && configuration.proStatus ) - Logger.logInfo("(FiltersConverter) - FiltersConverter for \(cbType) result: \(result.convertedCount) rules") - Logger.logDebug("(FiltersConverter) - FiltersConverter for \(cbType) result message: \(result.message)") + LOG.info("FiltersConverter for \(cbType) result: \(result.convertedCount) rules") + LOG.debug("FiltersConverter for \(cbType) result message: \(result.message)") // Just take the info we need let converterResult = FiltersConverterResult(type: cbType, conversionResult: result) return converterResult } - Logger.logInfo("(FiltersConverter) - convertFilters; Safari rules conversion finished") + LOG.info("Safari rules conversion finished") return conversionResult } } diff --git a/AdGuardSDK/AdGuardSDK/Safari/FiltersConvertation/FiltersConverterService.swift b/AdGuardSDK/AdGuardSDK/Safari/FiltersConvertation/FiltersConverterService.swift index 0f8eab5ba..2f7ce0313 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/FiltersConvertation/FiltersConverterService.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/FiltersConvertation/FiltersConverterService.swift @@ -27,6 +27,8 @@ protocol FiltersConverterServiceProtocol { func convertFiltersAndUserRulesToJsons() -> [FiltersConverterResult] } +private let LOG = LoggerFactory.getLoggerWrapper(FiltersConverterService.self) + /** This class is responsible for converting all enabled filters and user rules (blocklist / allowlist / inverted allowlist) to jsons objects */ @@ -97,7 +99,7 @@ final class FiltersConverterService: FiltersConverterServiceProtocol { if let filterFileString = filterFilesStorage.getFilterContentForFilter(withId: $0.0) { return FilterFileContent(text: filterFileString, group: $0.1) } else { - Logger.logError("(ContentBlockerService) - convertFiltersAndUserRulesToJsons; Received nil file content for filter with id=\($0.0)") + LOG.error("Received nil file content for filter with id=\($0.0)") return nil } } diff --git a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/DefaultDatabaseManager.swift b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/DefaultDatabaseManager.swift index b2b2d3874..20a301d2a 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/DefaultDatabaseManager.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/DefaultDatabaseManager.swift @@ -37,6 +37,8 @@ protocol DefaultDatabaseManagerProtocol { func removeDefaultDb() throws } +private let LOG = LoggerFactory.getLoggerWrapper(DefaultDatabaseManager.self) + final class DefaultDatabaseManager: DefaultDatabaseManagerProtocol { enum ManagerError: Error, CustomDebugStringConvertible { @@ -94,14 +96,14 @@ final class DefaultDatabaseManager: DefaultDatabaseManagerProtocol { // Unarchives default database file func updateDefaultDb() throws { - Logger.logInfo("(DefaultDatabaseManager) - updateDefaultDb; Unarchiving default.db") + LOG.info("Unarchiving default.db") let defaultDbArchiveUrl = dbContainerUrl.appendingPathComponent(defaultDbArchiveFile) try Zip.unzipFile(defaultDbArchiveUrl, destination: dbContainerUrl, overwrite: true, password: nil) } func removeDefaultDb() throws { guard defaultDbFileExists else { - Logger.logError("default.db file is missing, nothing to delete") + LOG.error("default.db file is missing, nothing to delete") return } diff --git a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Filters.swift b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Filters.swift index 99a1db91b..7a39576ef 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Filters.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Filters.swift @@ -133,6 +133,8 @@ protocol FiltersMetaStorageProtocol { func renameFilter(withId id: Int, name: String) throws } +private let LOG = LoggerFactory.getLoggerWrapper("MetaStorage+Filters") + extension MetaStorage: FiltersMetaStorageProtocol { // Checks existing filter id and returns new unique id for custom filter @@ -157,7 +159,7 @@ extension MetaStorage: FiltersMetaStorageProtocol { let description = filterLocalization?.description ?? filter.description return FiltersTable(dbFilter: dbFilter, localizedName: name, localizedDescription: description) } - Logger.logDebug("(FiltersMetaStorage) - getLocalizedFiltersForGroup with id=\(id); lang=\(lang); return \(dbFilters.count) objects") + LOG.debug("getLocalizedFiltersForGroup with id=\(id); lang=\(lang); return \(dbFilters.count) objects") return dbFilters } @@ -166,7 +168,7 @@ extension MetaStorage: FiltersMetaStorageProtocol { //Query: UPDATE "filters" SET "is_enabled" = enabled WHERE ("filter_id" = filterId) let query = FiltersTable.table.where(FiltersTable.filterId == id).update(FiltersTable.isEnabled <- enabled) let rowId = try filtersDb.run(query) - Logger.logInfo("(FiltersMetaStorage) - Filter enabled state with filter Id \(rowId) was updated to state \(enabled)") + LOG.info("Filter enabled state with filter Id \(rowId) was updated to state \(enabled)") } /** @@ -177,7 +179,7 @@ extension MetaStorage: FiltersMetaStorageProtocol { - Returns true if update occured and false otherwise */ func update(filter: ExtendedFilterMetaProtocol) throws -> Bool { - Logger.logDebug("(FiltersMetaStorage) - updateFilter start; Filter id=\(filter.filterId)") + LOG.debug("UpdateFilter start; Filter id=\(filter.filterId)") // Query: SELECT version FROM filters WHERE filter_id = filter.filterId @@ -185,7 +187,7 @@ extension MetaStorage: FiltersMetaStorageProtocol { if let currentFilterLastUpdateDate = try filtersDb.pluck(lastUpdateDateQuery)?.get(FiltersTable.lastUpdateTime) { if let newUpdateDate = filter.lastUpdateDate, currentFilterLastUpdateDate == newUpdateDate { - Logger.logInfo("(FiltersMetaStorage) - updateFilter; Update ended with reason: New meta update date is the same as current meta update date") + LOG.info("Update ended with reason: New meta update date is the same as current meta update date") return false } } @@ -196,7 +198,7 @@ extension MetaStorage: FiltersMetaStorageProtocol { .update(filter.updateSetters) try filtersDb.run(query) - Logger.logInfo("(FiltersMetaStorage) - Filter was updated with id \(filter.filterId)") + LOG.info("Filter was updated with id \(filter.filterId)") return true } @@ -206,7 +208,7 @@ extension MetaStorage: FiltersMetaStorageProtocol { - Returns array of filter ids that were updated */ func update(filters: [ExtendedFilterMetaProtocol]) throws -> [Int] { - Logger.logDebug("(FiltersMetaStorage) - updateFilters start; Filters number = \(filters.count)") + LOG.debug("updateFilters start; Filters number = \(filters.count)") return try filters.compactMap { let wasUpdated = try update(filter: $0) return wasUpdated ? $0.filterId : nil @@ -218,7 +220,7 @@ extension MetaStorage: FiltersMetaStorageProtocol { // Query: INSERT OR REPLACE INTO "filters" (filter_id, group_id, is_enabled, version, last_update_time, display_number, name, description, homepage, subscriptionUrl) let query = FiltersTable.table.insert(or: .replace, filter.getDbAddSetters(isEnabled: enabled)) try filtersDb.run(query) - Logger.logInfo("(FiltersMetaStorage) - Filter was added with id \(filter.filterId)") + LOG.info("Filter was added with id \(filter.filterId)") } // Deletes filter and all data associated with it @@ -230,7 +232,7 @@ extension MetaStorage: FiltersMetaStorageProtocol { func deleteFilters(withIds ids: [Int]) throws { let filtersToDelete = FiltersTable.table.filter(ids.contains(FiltersTable.filterId)) let deletedRows = try filtersDb.run(filtersToDelete.delete()) - Logger.logDebug("(FiltersMetaStorage) - deleteFilters; deleted \(deletedRows) filters") + LOG.debug("Deleted \(deletedRows) filters") try deleteLangsForFilters(withIds: ids) try deleteTagsForFilters(withIds: ids) @@ -241,6 +243,6 @@ extension MetaStorage: FiltersMetaStorageProtocol { // Query: UPDATE filters SET (name) WHERE filter_id = id let query = FiltersTable.table.where(FiltersTable.filterId == id).update(FiltersTable.name <- name) try filtersDb.run(query) - Logger.logDebug("(FiltersMetaStorage) - renameCustomFilterName; updated name for filter with id \(id) with name \(name)") + LOG.debug("Updated name for filter with id \(id) with name \(name)") } } diff --git a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+FiltersLocalizations.swift b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+FiltersLocalizations.swift index de820e5d6..3c4eabf6c 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+FiltersLocalizations.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+FiltersLocalizations.swift @@ -55,6 +55,8 @@ protocol FiltersLocalizationsMetaStorageProtocol { func collectFiltersMetaLocalizationLanguage(from suitableLanguages: [String]) throws -> String } +private let LOG = LoggerFactory.getLoggerWrapper("MetaStorage+FiltersLocalizations") + extension MetaStorage: FiltersLocalizationsMetaStorageProtocol { // Returns localized strings for specified filter and language @@ -66,7 +68,7 @@ extension MetaStorage: FiltersLocalizationsMetaStorageProtocol { return nil } let filterLocalization = FilterLocalizationsTable(dbFilterLocalization: dbFilterLocalization) - Logger.logDebug("(FiltersMetaStorage) - getLocalizationForFilter returning \(filterLocalization.name ?? "none") for filter with id=\(id) for lang=\(lang)") + LOG.debug("Returning \(filterLocalization.name ?? "none") for filter with id=\(id) for lang=\(lang)") return filterLocalization } @@ -80,7 +82,7 @@ extension MetaStorage: FiltersLocalizationsMetaStorageProtocol { FilterLocalizationsTable.name <- localization.name, FilterLocalizationsTable.description <- localization.description) try filtersDb.run(query) - Logger.logDebug("(FiltersMetaStorage) - Insert localization for filter with id=\(id) for lang=\(lang)") + LOG.debug("Insert localization for filter with id=\(id) for lang=\(lang)") } func deleteAllLocalizationForFilters(withIds ids: [Int]) throws { @@ -93,7 +95,7 @@ extension MetaStorage: FiltersLocalizationsMetaStorageProtocol { // Query: DELETE FROM filter_localizations WHERE filter_id = id let query = FilterLocalizationsTable.table.where(FilterLocalizationsTable.filterId == id).delete() try filtersDb.run(query) - Logger.logDebug("(FiltersMetaStorage) - Delete all localization for filter with id=\(id)") + LOG.debug("Delete all localization for filter with id=\(id)") } // MARK: - MetaStorage filters meta localization diff --git a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+GroupLocalizations.swift b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+GroupLocalizations.swift index 8f3c041d6..7cac3c4d3 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+GroupLocalizations.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+GroupLocalizations.swift @@ -49,6 +49,8 @@ protocol GroupLocalizationsMetaStorageProtocol { func collectGroupsMetaLocalizationLanguage(from suitableLanguages: [String]) throws -> String } +private let LOG = LoggerFactory.getLoggerWrapper("MetaStorage+GroupLocalizations") + extension MetaStorage: GroupLocalizationsMetaStorageProtocol { // Returns localized strings for specified group and language @@ -57,11 +59,11 @@ extension MetaStorage: GroupLocalizationsMetaStorageProtocol { let query = FilterGroupLocalizationsTable.table.filter(FilterGroupLocalizationsTable.groupId == id && FilterGroupLocalizationsTable.lang == lang) guard let dbGroulLocalization = try? filtersDb.pluck(query) else { - Logger.logDebug("(FiltersMetaStorage) - query result is nil for filter with id=\(id) for lang=\(lang)") + LOG.debug("Query result is nil for filter with id=\(id) for lang=\(lang)") return nil } let groupLocalization = FilterGroupLocalizationsTable(dbGroupLocalization: dbGroulLocalization) - Logger.logDebug("(FiltersMetaStorage) - getLocalizationForGroup returning \(groupLocalization) for filter with id=\(id) for lang=\(lang)") + LOG.debug("getLocalizationForGroup returning \(groupLocalization) for filter with id=\(id) for lang=\(lang)") return groupLocalization } @@ -73,7 +75,7 @@ extension MetaStorage: GroupLocalizationsMetaStorageProtocol { FilterGroupLocalizationsTable.lang <- lang, FilterGroupLocalizationsTable.name <- localization.name) try filtersDb.run(query) - Logger.logDebug("(FiltersMetaStorage) - Insert localization for group with id=\(id) lang=\(lang) and name=\(localization.name)") + LOG.debug("Insert localization for group with id=\(id) lang=\(lang) and name=\(localization.name)") } diff --git a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Groups.swift b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Groups.swift index e89a91969..90ad19aa1 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Groups.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Groups.swift @@ -70,6 +70,8 @@ protocol GroupsMetaStorageProtocol { func add(groups: [GroupMetaProtocol]) throws } +private let LOG = LoggerFactory.getLoggerWrapper("MetaStorage+Groups") + extension MetaStorage: GroupsMetaStorageProtocol { // Returns all groups with localization for specified language from database @@ -89,7 +91,7 @@ extension MetaStorage: GroupsMetaStorageProtocol { return FilterGroupsTable(dbGroup: group, localizedName: localizedName ?? dbGroup.name) } - Logger.logDebug("(FiltersMetaStorage) - getAllLocalizedGroups returning \(result.count) groups objects for lang=\(lang)") + LOG.debug("GetAllLocalizedGroups returning \(result.count) groups objects for lang=\(lang)") return result } @@ -98,7 +100,7 @@ extension MetaStorage: GroupsMetaStorageProtocol { // Query: UPDATE filter_groups SET is_enabled = enabled WHERE group_id = id let query = FilterGroupsTable.table.filter(FilterGroupsTable.groupId == id) try filtersDb.run(query.update(FilterGroupsTable.isEnabled <- enabled)) - Logger.logDebug("(FiltersMetaStorage) - setGroup group with id=\(id) was set to enabled=\(enabled)") + LOG.debug("SetGroup group with id=\(id) was set to enabled=\(enabled)") } // Updates group metadata with passed one @@ -108,7 +110,7 @@ extension MetaStorage: GroupsMetaStorageProtocol { .where(FilterGroupsTable.groupId == group.groupId) .update(FilterGroupsTable.name <- group.groupName, FilterGroupsTable.displayNumber <- group.displayNumber) try filtersDb.run(query) - Logger.logDebug("(FiltersMetaStorage) - Update group with id=\(group.groupId)") + LOG.debug("Update group with id=\(group.groupId)") } // Updates passed groups meta diff --git a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Langs.swift b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Langs.swift index fdae679a3..d1be6a733 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Langs.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Langs.swift @@ -47,6 +47,8 @@ protocol LangsMetaStorageProtocol { func deleteLangsForFilters(withIds ids: [Int]) throws } +private let LOG = LoggerFactory.getLoggerWrapper("MetaStorage+Langs") + extension MetaStorage: LangsMetaStorageProtocol { // Returns array of languages for filter with specified id func getLangsForFilter(withId id: Int) throws -> [String] { @@ -57,7 +59,7 @@ extension MetaStorage: LangsMetaStorageProtocol { let dbLang = FilterLangsTable(dbLang: lang) return dbLang.lang } - Logger.logDebug("(FiltersMetaStorage) - getLangsForFilter returning \(result.count) langs objects for filter with id=\(id)") + LOG.debug("Returning \(result.count) langs objects for filter with id=\(id)") return result } @@ -72,7 +74,7 @@ extension MetaStorage: LangsMetaStorageProtocol { } let langsToDelete = FilterLangsTable.table.filter(FilterLangsTable.filterId == id && !langs.contains(FilterLangsTable.lang)) let deletedRows = try filtersDb.run(langsToDelete.delete()) - Logger.logDebug("(FiltersMetaStorage) - updateAll langs; deleted \(deletedRows) rows") + LOG.debug("Deleted \(deletedRows) rows") } // Updates passed language for filter. If language is missing adds it @@ -80,13 +82,13 @@ extension MetaStorage: LangsMetaStorageProtocol { let query = FilterLangsTable.table.insert(or: .replace ,FilterLangsTable.filterId <- id, FilterLangsTable.lang <- lang) // Query: INSERT OR REPLACE INTO filter_langs (filter_id, lang) try filtersDb.run(query) - Logger.logDebug("(FiltersMetaStorage) - Insert row with filterID \(id) and lang \(lang)") + LOG.debug("Insert row with filterID \(id) and lang \(lang)") } // Deletes langs for filters with passed ids func deleteLangsForFilters(withIds ids: [Int]) throws { let langsToDelete = FilterLangsTable.table.filter(ids.contains(FilterLangsTable.filterId)) let deletedRows = try filtersDb.run(langsToDelete.delete()) - Logger.logDebug("(FiltersMetaStorage) - deleteLangsForFilters; deleted \(deletedRows) filters") + LOG.debug("Deleted \(deletedRows) filters") } } diff --git a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Tags.swift b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Tags.swift index 4f2c9ccab..c890323a1 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Tags.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage+Tags.swift @@ -62,6 +62,8 @@ protocol TagsMetaStorageProtocol { func deleteTagsForFilters(withIds ids: [Int]) throws } +private let LOG = LoggerFactory.getLoggerWrapper("TagsMetaStorageProtocol+Tags") + extension MetaStorage: TagsMetaStorageProtocol { // Returns all tags from database @@ -70,7 +72,7 @@ extension MetaStorage: TagsMetaStorageProtocol { let query = FilterTagsTable.table.order(FilterTagsTable.filterId) let result: [FilterTagsTable] = try filtersDb.prepare(query).map { FilterTagsTable(dbTag: $0) } - Logger.logDebug("(FiltersMetaStorage) - allTags returning \(result.count) tags objects") + LOG.debug("AllTags returning \(result.count) tags objects") return result } @@ -82,7 +84,7 @@ extension MetaStorage: TagsMetaStorageProtocol { .order(FilterTagsTable.tagId) let result: [FilterTagsTable] = try filtersDb.prepare(query).map { FilterTagsTable(dbTag: $0) } - Logger.logDebug("(FiltersMetaStorage) - getTagsForFilter returning \(result.count) tags objects for filter with id=\(id)") + LOG.debug("GetTagsForFilter returning \(result.count) tags objects for filter with id=\(id)") return result } @@ -100,7 +102,7 @@ extension MetaStorage: TagsMetaStorageProtocol { let tagsIds = tags.map { $0.tagId } let tagsToDelete = FilterTagsTable.table.filter(FilterTagsTable.filterId == id && !tagsIds.contains(FilterTagsTable.tagId)) let deletedRows = try filtersDb.run(tagsToDelete.delete()) - Logger.logDebug("(FiltersMetaStorage) - updateAll tags; deleted \(deletedRows) rows") + LOG.debug("Deleted \(deletedRows) rows") } // Updates passed tag for filter. If tag is missing adds it @@ -112,13 +114,13 @@ extension MetaStorage: TagsMetaStorageProtocol { FilterTagsTable.type <- tag.tagType.id, FilterTagsTable.name <- tag.tagName) try filtersDb.run(query) - Logger.logDebug("(FiltersMetaStorage) - Insert tag with tagId = \(tag.tagId) and name \(tag.tagName)") + LOG.debug("Insert tag with tagId = \(tag.tagId) and name \(tag.tagName)") } // Deletes tags for filters with passed ids func deleteTagsForFilters(withIds ids: [Int]) throws { let tagsToDelete = FilterTagsTable.table.filter(ids.contains(FilterTagsTable.filterId)) let deletedRows = try filtersDb.run(tagsToDelete.delete()) - Logger.logDebug("(FiltersMetaStorage) - deleteTagsForFilters; deleted \(deletedRows) filters") + LOG.debug("Deleted \(deletedRows) filters") } } diff --git a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage.swift b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage.swift index 835063b63..53446ce13 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/MetaStorage.swift @@ -30,6 +30,8 @@ protocol MetaStorageProtocol: MetaStorageTypeAlias, ResetableSyncProtocol, AnyOb static var defaultDbLanguage: String { get } } +private let LOG = LoggerFactory.getLoggerWrapper(MetaStorage.self) + final class MetaStorage: MetaStorageProtocol { // MARK: - Public properties @@ -56,19 +58,19 @@ final class MetaStorage: MetaStorageProtocol { // `busyHandler` is needed to handle error when db is locked and try once more self.filtersDb.busyTimeout = 5 self.filtersDb.busyHandler { _ in - Logger.logError("(MetaStorage) - init; Safari filters db is locked") + LOG.error("Safari filters db is locked") return true } insertCustomGroupIfNeeded() } func reset() throws { - Logger.logInfo("(MetaStorage) - reset start") + LOG.info("Reset start") try productionDbManager.reset() filtersDb = productionDbManager.filtersDb - Logger.logInfo("(MetaStorage) - reset; Successfully reset adguard.db reinitialize Connection object now") + LOG.info("Successfully reset adguard.db reinitialize Connection object now") } /* @@ -91,7 +93,7 @@ final class MetaStorage: MetaStorageProtocol { FilterGroupsTable.isEnabled <- false) try filtersDb.run(insertionQuery) } catch { - Logger.logError("Custom group insertion error: \(error)") + LOG.error("Custom group insertion error: \(error)") } } } diff --git a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/ProductionDatabaseManager.swift b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/ProductionDatabaseManager.swift index 3479bf655..76408f2be 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/ProductionDatabaseManager.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/FiltersMetadata/FiltersMetaStorage/ProductionDatabaseManager.swift @@ -34,6 +34,8 @@ protocol ProductionDatabaseManagerProtocol: ResetableSyncProtocol { func updateDatabaseIfNeeded() throws } +private let LOG = LoggerFactory.getLoggerWrapper(ProductionDatabaseManager.self) + final class ProductionDatabaseManager: ProductionDatabaseManagerProtocol { enum ManagerError: Error, CustomDebugStringConvertible { @@ -100,7 +102,7 @@ final class ProductionDatabaseManager: ProductionDatabaseManagerProtocol { // MARK: - Public methods func updateDatabaseIfNeeded() throws { - Logger.logInfo("(ProductionDatabaseManager) - updateDatabaseIfNeeded start") + LOG.info("updateDatabaseIfNeeded start") try defaultDatabaseManager.updateDefaultDb() @@ -115,11 +117,11 @@ final class ProductionDatabaseManager: ProductionDatabaseManagerProtocol { // Remove default.db when update finished try defaultDatabaseManager.removeDefaultDb() - Logger.logInfo("(ProductionDatabaseManager) - updateDatabaseIfNeeded finished; shouldUpgradeDb=\(shouldUpgradeDb); updateVersions=\(updateVersions)") + LOG.info("shouldUpgradeDb=\(shouldUpgradeDb); updateVersions=\(updateVersions)") } func reset() throws { - Logger.logInfo("(ProductionDatabaseManager) - reset start") + LOG.info("Reset start") // Update default.db to the latest saved try defaultDatabaseManager.updateDefaultDb() @@ -130,7 +132,7 @@ final class ProductionDatabaseManager: ProductionDatabaseManagerProtocol { // Reinitialize database object filtersDb = try Connection(productionDbFileUrl.path) - Logger.logInfo("(ProductionDatabaseManager) - reset; Successfully reset adguard.db") + LOG.info("Successfully reset adguard.db") } // MARK: - Private methods diff --git a/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+BackgroundFetch.swift b/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+BackgroundFetch.swift index ccc15bbbd..c7f432a06 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+BackgroundFetch.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+BackgroundFetch.swift @@ -85,6 +85,8 @@ public protocol SafariProtectionBackgroundFetchProtocol { func finishBackgroundUpdate(_ onUpdateFinished: @escaping (_ error: Error?) -> Void) } +private let LOG = LoggerFactory.getLoggerWrapper("SafariProtection+BackgroundFetch") + /* Extension is used to update filters while main app is in the background */ extension SafariProtection { @@ -100,7 +102,7 @@ extension SafariProtection { // MARK: - Public methods public func updateSafariProtectionInBackground(_ onStateExecutionFinished: @escaping (_ result: BackgroundFetchUpdateResult) -> Void) { - Logger.logInfo("(SafariProtection+BackgroundFetch) - updateSafariProtectionInBackground; Start background fetch, current state = \(currentBackgroundFetchState)") + LOG.info("Start background fetch, current state = \(currentBackgroundFetchState)") switch currentBackgroundFetchState { case .loadAndSaveFilters, .updateFinished: @@ -115,12 +117,12 @@ extension SafariProtection { public func finishBackgroundUpdate(_ onUpdateFinished: @escaping (_ error: Error?) -> Void) { BackgroundTaskExecutor.executeAsynchronousTask("SafariProtection+BackgroundFetch.finishBackgroundUpdate") { [weak self] onTaskFinished in guard let self = self else { - Logger.logError("(SafariProtection+BackgroundFetch) - finishBackgroundUpdate; Missing self") + LOG.error("Missing self") onUpdateFinished(CommonError.missingSelf) onTaskFinished() return } - Logger.logInfo("(SafariProtection+BackgroundFetch) - finishBackgroundUpdate start; Current state = \(self.currentBackgroundFetchState)") + LOG.info("Current state = \(self.currentBackgroundFetchState)") switch self.currentBackgroundFetchState { case .loadAndSaveFilters: @@ -168,7 +170,7 @@ extension SafariProtection { // 1st step of background update private func updateFilters(_ onFiltersUpdated: @escaping (_ result: BackgroundFetchUpdateResult) -> Void) { - Logger.logInfo("(SafariProtection+BackgroundFetch) - updateFilters start") + LOG.info("updateFilters start") workingQueue.async { [weak self] in guard let self = self else { return } @@ -211,18 +213,18 @@ extension SafariProtection { oldBackgroundFetchState: oldState, error: nil ) - Logger.logInfo("(SafariProtection+BackgroundFetch) - updateFilters; Filters were successfully loaded and saved; Update result: \(result)") + LOG.info("Filters were successfully loaded and saved; Update result: \(result)") onFiltersUpdated(result) return } // Failed to update if let error = safariFiltersUpdateError { - Logger.logError("(SafariProtection+BackgroundFetch) - updateFilters; Safari update error: \(error)") + LOG.error("Safari update error: \(error)") } if let error = dnsFiltersUpdateError { - Logger.logError("(SafariProtection+BackgroundFetch) - updateFilters; DNS update error: \(error)") + LOG.error("DNS update error: \(error)") } let result = BackgroundFetchUpdateResult( backgroundFetchResult: .noData, @@ -237,7 +239,7 @@ extension SafariProtection { // 2nd step of the background update private func convertFilters(_ onFiltersConverted: @escaping (_ result: BackgroundFetchUpdateResult) -> Void) { - Logger.logInfo("(SafariProtection+BackgroundFetch) - convertFiltersInBackground start") + LOG.info("convertFiltersInBackground start") cbQueue.async { let oldState = self.currentBackgroundFetchState @@ -245,7 +247,7 @@ extension SafariProtection { let convertedFilters = self.converter.convertFiltersAndUserRulesToJsons() try self.cbStorage.save(converterResults: convertedFilters) self.currentBackgroundFetchState = .reloadContentBlockers - Logger.logInfo("(SafariProtection+BackgroundFetch) - convertFilters; Successfully converted all filters to JSONs") + LOG.info("Successfully converted all filters to JSONs") let result = BackgroundFetchUpdateResult( backgroundFetchResult: .newData, newBackgroundFetchState: .reloadContentBlockers, @@ -253,7 +255,7 @@ extension SafariProtection { error: nil) self.completionQueue.async { onFiltersConverted(result) } } catch { - Logger.logError("(SafariProtection+BackgroundFetch) - convertFilters; Error converting filters: \(error)") + LOG.error("Error converting filters: \(error)") let result = BackgroundFetchUpdateResult( backgroundFetchResult: .noData, newBackgroundFetchState: oldState, @@ -266,7 +268,7 @@ extension SafariProtection { // 3rd step of background update private func reloadContentBlockers(_ onCbReloaded: @escaping (_ result: BackgroundFetchUpdateResult) -> Void) { - Logger.logInfo("(SafariProtection+BackgroundFetch) - reloadContentBlockers start") + LOG.info("reloadContentBlockers start") cbQueue.async { [weak self] in self?.cbService.updateContentBlockers { [weak self] error in @@ -275,7 +277,7 @@ extension SafariProtection { let oldState = self.currentBackgroundFetchState if let error = error { - Logger.logError("(SafariProtection+BackgroundFetch) - reloadContentBlockers; Error reloading CBs: \(error)") + LOG.error("Error reloading CBs: \(error)") let result = BackgroundFetchUpdateResult( backgroundFetchResult: .noData, newBackgroundFetchState: oldState, @@ -284,7 +286,7 @@ extension SafariProtection { ) self.completionQueue.async { onCbReloaded(result) } } else { - Logger.logInfo("(SafariProtection+BackgroundFetch) - reloadContentBlockers; Successfully reloaded all CBs") + LOG.info("Successfully reloaded all CBs") self.currentBackgroundFetchState = .updateFinished let result = BackgroundFetchUpdateResult( backgroundFetchResult: .newData, diff --git a/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+Configuration.swift b/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+Configuration.swift index 059349f0e..fdad15125 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+Configuration.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+Configuration.swift @@ -64,6 +64,8 @@ public protocol SafariProtectionConfigurationProtocol { func updateConfig(with newConfig: SafariConfigurationProtocol) } +private let LOG = LoggerFactory.getLoggerWrapper("SafariProtection+Configuration") + /* Extension is used to properly process all configuration changes */ extension SafariProtection { public var proStatus: Bool { @@ -92,7 +94,7 @@ extension SafariProtection { public func update(proStatus: Bool, onCbReloaded: ((_ error: Error?) -> Void)?) { workingQueue.sync { - Logger.logInfo("(SafariProtection+Configuration) - updateProStatus; Updating proStatus from=\(self.configuration.proStatus) to=\(proStatus)") + LOG.info("Updating proStatus from=\(self.configuration.proStatus) to=\(proStatus)") executeBlockAndReloadCbs { if configuration.proStatus != proStatus { @@ -103,15 +105,15 @@ extension SafariProtection { } } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+Configuration) - update.proStatus.reloadContentBlockers; self is missing!") + LOG.error("update.proStatus.reloadContentBlockers; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+Configuration) - updateProStatus; Error reloading CBs when updating proStatus; Error: \(error)") + LOG.error("Error reloading CBs when updating proStatus; Error: \(error)") } else { - Logger.logInfo("(SafariProtection+Configuration) - updateProStatus; Successfully reloaded CBs after updating proStatus") + LOG.info("Successfully reloaded CBs after updating proStatus") } self.completionQueue.async { onCbReloaded?(error) } } @@ -120,7 +122,7 @@ extension SafariProtection { public func update(safariProtectionEnabled: Bool, onCbReloaded: ((_ error: Error?) -> Void)?) { workingQueue.sync { - Logger.logInfo("(SafariProtection+Configuration) - updateSafariProtection; Updating safariProtection from=\(self.configuration.safariProtectionEnabled) to=\(safariProtectionEnabled)") + LOG.info("Updating safariProtection from=\(self.configuration.safariProtectionEnabled) to=\(safariProtectionEnabled)") executeBlockAndReloadCbs { if configuration.safariProtectionEnabled != safariProtectionEnabled { @@ -131,15 +133,15 @@ extension SafariProtection { } } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+Configuration) - update.safariProtection.reloadContentBlockers; self is missing!") + LOG.error("update.safariProtection.reloadContentBlockers; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+Configuration) - updateSafariProtection; Error reloading CBs when updating safariProtection; Error: \(error)") + LOG.error("Error reloading CBs when updating safariProtection; Error: \(error)") } else { - Logger.logInfo("(SafariProtection+Configuration) - updateSafariProtection; Successfully reloaded CBs after updating safariProtection") + LOG.info("Successfully reloaded CBs after updating safariProtection") } self.completionQueue.async { onCbReloaded?(error) } } @@ -148,29 +150,29 @@ extension SafariProtection { public func update(advancedProtectionEnabled: Bool) { workingQueue.sync { - Logger.logInfo("(SafariProtection+Configuration) - updateAdvancedProtection; Updating updateAdvancedProtection from=\(self.configuration.advancedBlockingIsEnabled) to=\(advancedProtectionEnabled)") + LOG.info("Updating updateAdvancedProtection from=\(self.configuration.advancedBlockingIsEnabled) to=\(advancedProtectionEnabled)") let result = updateInternal(advancedProtectionEnabled: advancedProtectionEnabled) - Logger.logInfo("(SafariProtection+Configuration - updateAdvancedProtection; advancedProtection was updated = \(result)") + LOG.info("advancedProtection was updated = \(result)") } } public func update(advancedProtectionEnabled: Bool, onCbReloaded: ((Error?) -> Void)?) { workingQueue.sync { - Logger.logInfo("(SafariProtection+Configuration) - updateAdvancedProtection; Updating updateAdvancedProtection from=\(self.configuration.advancedBlockingIsEnabled) to=\(advancedProtectionEnabled)") + LOG.info("Updating updateAdvancedProtection from=\(self.configuration.advancedBlockingIsEnabled) to=\(advancedProtectionEnabled)") executeBlockAndReloadCbs { return updateInternal(advancedProtectionEnabled: advancedProtectionEnabled) } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+Configuration) - update.advancedProtection.reloadContentBlockers; self is missing!") + LOG.error("update.advancedProtection.reloadContentBlockers; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+Configuration) - updateAdvancedProtection; Error reloading CBs when updating advancedProtection; Error: \(error)") + LOG.error("Error reloading CBs when updating advancedProtection; Error: \(error)") } else { - Logger.logInfo("(SafariProtection+Configuration) - updateAdvancedProtection; Successfully reloaded CBs after updating advancedProtection") + LOG.info("Successfully reloaded CBs after updating advancedProtection") } self.completionQueue.async { onCbReloaded?(error) } } @@ -179,7 +181,7 @@ extension SafariProtection { public func update(blocklistIsEnabled: Bool, onCbReloaded: ((_ error: Error?) -> Void)?) { workingQueue.sync { - Logger.logInfo("(SafariProtection+Configuration) - updateBlocklistIsEnabled; Updating blocklist state from=\(self.configuration.blocklistIsEnabled) to=\(blocklistIsEnabled)") + LOG.info("Updating blocklist state from=\(self.configuration.blocklistIsEnabled) to=\(blocklistIsEnabled)") executeBlockAndReloadCbs { if configuration.blocklistIsEnabled != blocklistIsEnabled { @@ -190,15 +192,15 @@ extension SafariProtection { } } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+Configuration) - update.blocklistIsEnabled.reloadContentBlockers; self is missing!") + LOG.error("update.blocklistIsEnabled.reloadContentBlockers; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+Configuration) - updateBlocklistIsEnabled; Error reloading CBs when updating blocklist state; Error: \(error)") + LOG.error("Error reloading CBs when updating blocklist state; Error: \(error)") } else { - Logger.logInfo("(SafariProtection+Configuration) - updateBlocklistIsEnabled; Successfully reloaded CBs after updating blocklist state") + LOG.info("Successfully reloaded CBs after updating blocklist state") } self.completionQueue.async { onCbReloaded?(error) } } @@ -207,7 +209,7 @@ extension SafariProtection { public func update(allowlistIsEnabled: Bool, onCbReloaded: ((_ error: Error?) -> Void)?) { workingQueue.sync { - Logger.logInfo("(SafariProtection+Configuration) - updateAllowlistIsEnabled; Updating allowlist state from=\(self.configuration.allowlistIsEnabled) to=\(allowlistIsEnabled)") + LOG.info("Updating allowlist state from=\(self.configuration.allowlistIsEnabled) to=\(allowlistIsEnabled)") executeBlockAndReloadCbs { if configuration.allowlistIsEnabled != allowlistIsEnabled { @@ -218,15 +220,15 @@ extension SafariProtection { } } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+Configuration) - update.allowlistIsEnabled.reloadContentBlockers; self is missing!") + LOG.error("update.allowlistIsEnabled.reloadContentBlockers; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+Configuration) - updateAllowlistIsEnabled; Error reloading CBs when updating allowlist state; Error: \(error)") + LOG.error("Error reloading CBs when updating allowlist state; Error: \(error)") } else { - Logger.logInfo("(SafariProtection+Configuration) - updateAllowlistIsEnabled; Successfully reloaded CBs after updating allowlist state") + LOG.info("Successfully reloaded CBs after updating allowlist state") } self.completionQueue.async { onCbReloaded?(error) } } @@ -235,7 +237,7 @@ extension SafariProtection { public func update(allowlistIsInverted: Bool, onCbReloaded: ((_ error: Error?) -> Void)?) { workingQueue.sync { - Logger.logInfo("(SafariProtection+Configuration) - updateAllowlistIsInverted; Updating allowlist invertion state from=\(self.configuration.allowlistIsInverted) to=\(allowlistIsInverted)") + LOG.info("Updating allowlist invertion state from=\(self.configuration.allowlistIsInverted) to=\(allowlistIsInverted)") executeBlockAndReloadCbs { if configuration.allowlistIsInverted != allowlistIsInverted { @@ -246,15 +248,15 @@ extension SafariProtection { } } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+Configuration) - update.allowlistIsInverted.reloadContentBlockers; self is missing!") + LOG.error("update.allowlistIsInverted.reloadContentBlockers; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+Configuration) - updateAllowlistIsEnabled; Error reloading CBs when updating allowlist invertion; Error: \(error)") + LOG.error("Error reloading CBs when updating allowlist invertion; Error: \(error)") } else { - Logger.logInfo("(SafariProtection+Configuration) - updateAllowlistIsEnabled; Successfully reloaded CBs after updating allowlist invertion") + LOG.info("Successfully reloaded CBs after updating allowlist invertion") } self.completionQueue.async { onCbReloaded?(error) } } @@ -263,7 +265,7 @@ extension SafariProtection { public func updateConfig(with newConfig: SafariConfigurationProtocol) { workingQueue.sync { - Logger.logInfo("(SafariProtection+Configuration) - updateConfig;") + LOG.info("updateConfig;") configuration.updateConfig(with: newConfig) } } @@ -275,7 +277,7 @@ extension SafariProtection { configuration.advancedBlockingIsEnabled = advancedProtectionEnabled return true } else { - Logger.logInfo("(SafariProtection+Configuration) - updateInternalAdvancedProtection; Advanced protection hasn't been updated; reason - old value is equal to new value") + LOG.info("Advanced protection hasn't been updated; reason - old value is equal to new value") return false } } diff --git a/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+Filters.swift b/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+Filters.swift index a6657f390..ad8014b8f 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+Filters.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+Filters.swift @@ -124,6 +124,8 @@ public protocol SafariProtectionFiltersProtocol { func enablePredefinedGroupsAndFilters() throws } +private let LOG = LoggerFactory.getLoggerWrapper("SafariProtection+Filters") + /* Extension is used to interact with filters and groups object and properly process operations with them */ extension SafariProtection { @@ -153,20 +155,20 @@ extension SafariProtection { public func setGroup(groupType: SafariGroup.GroupType, enabled: Bool, onCbReloaded: ((_ error: Error?) -> Void)?) throws { try workingQueue.sync { try executeBlockAndReloadCbs { - Logger.logInfo("(SafariProtection+Filters) - setGroup; Setting group with id=\(groupType.id) to enabled=\(enabled)") + LOG.info("Setting group with id=\(groupType.id) to enabled=\(enabled)") try setGroupInternal(groupType, enabled: enabled) return true } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+Filters) - setGroup.onCbReloaded; self is missing!") + LOG.error("setGroup.onCbReloaded; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+Filters) - setGroup.onCbReloaded; Error reloading CBs when setting group with id=\(groupType.id) to enabled=\(enabled): \(error)") + LOG.error("setGroup.onCbReloaded; Error reloading CBs when setting group with id=\(groupType.id) to enabled=\(enabled): \(error)") } else { - Logger.logInfo("(SafariProtection+Filters) - setGroup.onCbReloaded; Successfully reloaded CBs after setting group with id=\(groupType.id) to enabled=\(enabled)") + LOG.info("setGroup.onCbReloaded; Successfully reloaded CBs after setting group with id=\(groupType.id) to enabled=\(enabled)") } self.completionQueue.async { onCbReloaded?(error) } } @@ -182,20 +184,20 @@ extension SafariProtection { public func setFilter(withId id: Int, groupId: Int, enabled: Bool, onCbReloaded: ((_ error: Error?) -> Void)?) throws { try workingQueue.sync { try executeBlockAndReloadCbs { - Logger.logInfo("(SafariProtection+Filters) - setFilter; Setting filter with id=\(id), group id=\(groupId) to enabled=\(enabled)") + LOG.info("Setting filter with id=\(id), group id=\(groupId) to enabled=\(enabled)") try setFilterInternal(withId: id, groupId: groupId, enabled: enabled) return true } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+Filters) - setFilter.onCbReloaded; self is missing!") + LOG.error("setFilter.onCbReloaded; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+Filters) - setFilter.onCbReloaded; Error reloading CBs when setting filter with id=\(id), group id=\(groupId) to enabled=\(enabled): \(error)") + LOG.error("setFilter.onCbReloaded; Error reloading CBs when setting filter with id=\(id), group id=\(groupId) to enabled=\(enabled): \(error)") } else { - Logger.logInfo("(SafariProtection+Filters) - setFilter.onCbReloaded; Successfully reloaded CBs after setting filter with id=\(id), group id=\(groupId) to enabled=\(enabled)") + LOG.info("setFilter.onCbReloaded; Successfully reloaded CBs after setting filter with id=\(id), group id=\(groupId) to enabled=\(enabled)") } self.completionQueue.async { onCbReloaded?(error) } } @@ -209,12 +211,12 @@ extension SafariProtection { ) { workingQueue.async { [weak self] in guard let self = self else { - Logger.logError("(SafariProtection+Filters) - addCustomFilter; self is missing!") + LOG.error("Self is missing!") DispatchQueue.main.async { onFilterAddedToDb?(CommonError.missingSelf) } return } - Logger.logInfo("(SafariProtection+Filters) - addCustomFilter; Add custom filter: \(customFilter)") + LOG.info("Add custom filter: \(customFilter)") var addError: Error? let group = DispatchGroup() group.enter() @@ -225,7 +227,7 @@ extension SafariProtection { group.wait() if let addError = addError { - Logger.logError("(SafariProtection+Filters) - addCustomFilter; Error adding custom filter: \(customFilter) to storage, error: \(addError)") + LOG.error("Error adding custom filter: \(customFilter) to storage, error: \(addError)") self.completionQueue.async { onFilterAddedToDb?(addError) } return } @@ -242,7 +244,7 @@ extension SafariProtection { add(customFilter: customFilter, enabled: enabled) { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+Filters) - addCustomFilter; self is missing!") + LOG.error("Self is missing!") DispatchQueue.main.async { onFilterAddedToDb?(CommonError.missingSelf); onCbReloaded?(CommonError.missingSelf) } return } @@ -257,15 +259,15 @@ extension SafariProtection { self.reloadContentBlockers { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+Filters) - addCustomFilter.onCbReloaded; self is missing!") + LOG.error("addCustomFilter.onCbReloaded; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+Filters) - addCustomFilter.onCbReloaded; Error reloading CBs when adding custom filter: \(customFilter); Error: \(error)") + LOG.error("addCustomFilter.onCbReloaded; Error reloading CBs when adding custom filter: \(customFilter); Error: \(error)") } else { - Logger.logInfo("(SafariProtection+Filters) - addCustomFilter.onCbReloaded; Successfully reloaded CBs after adding custom filter: \(customFilter)") + LOG.info("addCustomFilter.onCbReloaded; Successfully reloaded CBs after adding custom filter: \(customFilter)") } self.completionQueue.async { onCbReloaded?(error) } } @@ -281,20 +283,20 @@ extension SafariProtection { public func deleteCustomFilter(withId id: Int, onCbReloaded: ((_ error: Error?) -> Void)?) throws { try workingQueue.sync { try executeBlockAndReloadCbs { - Logger.logInfo("(SafariProtection+Filters) - deleteCustomFilter; Delete custom filter with id=\(id)") + LOG.info("Delete custom filter with id=\(id)") try deleteCustomFilterInternal(withId: id) return true } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+Filters) - deleteCustomFilter.onCbReloaded; self is missing!") + LOG.error("deleteCustomFilter.onCbReloaded; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+Filters) - deleteCustomFilter.onCbReloaded; Error reloading CBs when deleting custom filter with id=\(id): \(error)") + LOG.error("deleteCustomFilter.onCbReloaded; Error reloading CBs when deleting custom filter with id=\(id): \(error)") } else { - Logger.logInfo("(SafariProtection+Filters) - deleteCustomFilter.onCbReloaded; Successfully reloaded CBs after deleting custom filter with id=\(id)") + LOG.info("deleteCustomFilter.onCbReloaded; Successfully reloaded CBs after deleting custom filter with id=\(id)") } self.completionQueue.async { onCbReloaded?(error) } } @@ -303,7 +305,7 @@ extension SafariProtection { public func renameCustomFilter(withId id: Int, to name: String) throws { try workingQueue.sync { - Logger.logInfo("(SafariProtection+Filters) - renameCustomFilter; Rename custom filter with id=\(id) to name=\(name)") + LOG.info("Rename custom filter with id=\(id) to name=\(name)") try self.filters.renameCustomFilter(withId: id, to: name) } } @@ -316,7 +318,7 @@ extension SafariProtection { BackgroundTaskExecutor.executeAsynchronousTask("SafariProtection+Filters.updateFiltersMetaAndLocalizations") { [weak self] onTaskFinished in self?.workingQueue.async { [weak self] in guard let self = self else { - Logger.logError("(SafariProtection+Filters) - updateFiltersMetaAndLocalizations; self is missing!") + LOG.error("Self is missing!") DispatchQueue.main.async { onFiltersUpdated(.error(CommonError.missingSelf)) onCbReloaded(CommonError.missingSelf) @@ -325,11 +327,11 @@ extension SafariProtection { return } - Logger.logInfo("(SafariProtection+Filters) - updateFiltersMetaAndLocalizations; Updating filters meta forcibly=\(forcibly)") + LOG.info("Updating filters meta forcibly=\(forcibly)") self.filters.updateAllMeta(forcibly: forcibly) { [weak self] result in guard let self = self else { - Logger.logError("(SafariProtection+Filters) - updateFiltersMetaAndLocalizations.updateAllMeta; self is missing!") + LOG.error("updateFiltersMetaAndLocalizations.updateAllMeta; self is missing!") DispatchQueue.main.async { onFiltersUpdated(.error(CommonError.missingSelf)) onCbReloaded(CommonError.missingSelf) @@ -343,7 +345,7 @@ extension SafariProtection { self.reloadContentBlockers { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+Filters) - updateFiltersMetaAndLocalizations.reloadContentBlockers; self is missing!") + LOG.error("updateFiltersMetaAndLocalizations.reloadContentBlockers; self is missing!") DispatchQueue.main.async { onCbReloaded(CommonError.missingSelf) onTaskFinished() @@ -363,26 +365,26 @@ extension SafariProtection { public func enablePredefinedGroupsAndFilters() throws { try workingQueue.sync { - Logger.logInfo("(SafariProtection+Filters) - enablePredefinedGroupsAndFilters; Start enabling predefined groups and filters") + LOG.info("Start enabling predefined groups and filters") try self.filters.enablePredefinedGroupsAndFilters() - Logger.logInfo("(SafariProtection+Filters) - enablePredefinedGroupsAndFilters; Enabling predefined groups and filters successfully ended") + LOG.info("Enabling predefined groups and filters successfully ended") } } // MARK: - Private methods private func setGroupInternal(_ groupType: SafariGroup.GroupType, enabled: Bool) throws { - Logger.logInfo("(SafariProtection+Filters) - setGroupInternal; Setting group with id=\(groupType.id) to enabled=\(enabled)") + LOG.info("Setting group with id=\(groupType.id) to enabled=\(enabled)") try filters.setGroup(withId: groupType.id, enabled: enabled) } private func setFilterInternal(withId id: Int, groupId: Int, enabled: Bool) throws { - Logger.logInfo("(SafariProtection+Filters) - setFilterInternal; Setting filter with id=\(id), group id=\(groupId) to enabled=\(enabled)") + LOG.info("Setting filter with id=\(id), group id=\(groupId) to enabled=\(enabled)") try self.filters.setFilter(withId: id, groupId, enabled: enabled) } private func deleteCustomFilterInternal(withId id: Int) throws { - Logger.logInfo("(SafariProtection+Filters) - deleteCustomFilterInternal; Delete custom filter with id=\(id)") + LOG.info("Delete custom filter with id=\(id)") try self.filters.deleteCustomFilter(withId: id) } } diff --git a/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+Migrations.swift b/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+Migrations.swift index cca375744..230ef86a6 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+Migrations.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+Migrations.swift @@ -29,6 +29,8 @@ public protocol SafariProtectionMigrationsProtocol: AnyObject { func convertFiltersAndReloadCbs(onCbReloaded: ((_ error: Error?) -> Void)?) } +private let LOG = LoggerFactory.getLoggerWrapper("SafariProtection+Migrations") + // TODO: - We should change the way we migrate data in main app and remove this extension /// This extension is responsible for providing methods for migration in main app extension SafariProtection: SafariProtectionMigrationsProtocol { @@ -36,19 +38,19 @@ extension SafariProtection: SafariProtectionMigrationsProtocol { public func getRules(for type: SafariUserRuleType) -> [UserRule] { workingQueue.sync { let allRules = getProvider(for: type).allRules - Logger.logInfo("(SafariProtection+Migrations) - getRules; Getting rules \(allRules.count) for type=\(type)") + LOG.info("Getting rules \(allRules.count) for type=\(type)") return allRules } } public func removeRules(for type: SafariUserRuleType) { - Logger.logInfo("(SafariProtection+Migrations) - removeRules; Remove all rules for type=\(type)") + LOG.info("Remove all rules for type=\(type)") removeAllRules(for: type) } public func add(rules: [UserRule], for type: SafariUserRuleType, override: Bool) throws { try workingQueue.sync { - Logger.logInfo("(SafariProtection+Migrations) - addRules; Adding \(rules.count) rules; for type=\(type); override=\(override)") + LOG.info("Adding \(rules.count) rules; for type=\(type); override=\(override)") let provider = self.getProvider(for: type) try provider.add(rules: rules, override: override) @@ -57,14 +59,14 @@ extension SafariProtection: SafariProtectionMigrationsProtocol { public func setGroup(_ groupType: SafariGroup.GroupType, enabled: Bool) throws { try workingQueue.sync { - Logger.logInfo("(SafariProtection+Migrations) - setGroup; Setting group with id=\(groupType.id) to enabled=\(enabled)") + LOG.info("Setting group with id=\(groupType.id) to enabled=\(enabled)") try filters.setGroup(withId: groupType.id, enabled: enabled) } } public func setFilter(withId id: Int, _ groupId: Int, enabled: Bool) throws { try workingQueue.sync { - Logger.logInfo("(SafariProtection+Migrations) - setFilter; Setting filter with id=\(id), group id=\(groupId) to enabled=\(enabled)") + LOG.info("Setting filter with id=\(id), group id=\(groupId) to enabled=\(enabled)") try self.filters.setFilter(withId: id, groupId, enabled: enabled) } } @@ -79,7 +81,7 @@ extension SafariProtection: SafariProtectionMigrationsProtocol { BackgroundTaskExecutor.executeAsynchronousTask("SafariProtection+Migrations.convertFiltersAndReloadCbs") { [weak self] onTaskFinished in self?.cbQueue.async { [weak self] in guard let self = self else { - Logger.logError("(SafariProtection+Migrations) - reloadContentBlockers; self is missing!") + LOG.error("Self is missing!") onCbReloaded?(CommonError.missingSelf) onTaskFinished() return @@ -90,7 +92,7 @@ extension SafariProtection: SafariProtectionMigrationsProtocol { try self.cbStorage.save(converterResults: convertedfilters) } catch { - Logger.logError("(SafariProtection+Migrations) - createNewCbJsonsAndReloadCbs; Error conveerting filters: \(error)") + LOG.error("Error conveerting filters: \(error)") self.completionQueue.async { onCbReloaded?(error) onTaskFinished() @@ -100,7 +102,7 @@ extension SafariProtection: SafariProtectionMigrationsProtocol { self.cbService.updateContentBlockers { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+Migrations) - reloadContentBlockers; self is missing!") + LOG.error("Self is missing!") self?.completionQueue.async { onCbReloaded?(CommonError.missingSelf) onTaskFinished() diff --git a/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+UserRules.swift b/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+UserRules.swift index cb8809ef0..ae55e69f2 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+UserRules.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection+UserRules.swift @@ -146,6 +146,8 @@ public protocol SafariProtectionUserRulesProtocol { func removeAllUserRulesAssociatedWith(domain: String, onCbReloaded: ((Error?) -> Void)?) } +private let LOG = LoggerFactory.getLoggerWrapper("SafariProtection+UserRules") + /* Extension is used to interact with all available user rules lists and properly process operations with them */ extension SafariProtection { @@ -153,7 +155,7 @@ extension SafariProtection { public func rulesString(for type: SafariUserRuleType) -> String { workingQueue.sync { - Logger.logInfo("(SafariProtection+UserRules) - rulesString; Returning rules string for type=\(type)") + LOG.info("Returning rules string for type=\(type)") let provider = getProvider(for: type) return provider.rulesString } @@ -161,7 +163,7 @@ extension SafariProtection { public func allRules(for type: SafariUserRuleType) -> [UserRule] { workingQueue.sync { - Logger.logInfo("(SafariProtection+UserRules) - allRules; Returning all rules for type=\(type)") + LOG.info("Returning all rules for type=\(type)") let provider = getProvider(for: type) return provider.allRules } @@ -180,15 +182,15 @@ extension SafariProtection { return true } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+UserRules) - addRule.onCbReloaded; self is missing!") + LOG.error("addRule.onCbReloaded; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+UserRules) - addRule.onCbReloaded; Error reloading CBs when adding rule: \(rule) for type=\(type), override=\(override); Error: \(error)") + LOG.error("addRule.onCbReloaded; Error reloading CBs when adding rule: \(rule) for type=\(type), override=\(override); Error: \(error)") } else { - Logger.logInfo("(SafariProtection+UserRules) - addRule.onCbReloaded; Successfully reloaded CBs after adding rule: \(rule) for type=\(type), override=\(override)") + LOG.info("addRule.onCbReloaded; Successfully reloaded CBs after adding rule: \(rule) for type=\(type), override=\(override)") } self.completionQueue.async { onCbReloaded?(error) } } @@ -197,7 +199,7 @@ extension SafariProtection { public func add(rules: [UserRule], for type: SafariUserRuleType, override: Bool, onCbReloaded: ((Error?) -> Void)?) throws { try workingQueue.sync { - Logger.logInfo("(SafariProtection+UserRules) - addRules; Adding \(rules.count) rules; for type=\(type); override=\(override)") + LOG.info("Adding \(rules.count) rules; for type=\(type); override=\(override)") let provider = self.getProvider(for: type) try executeBlockAndReloadCbs { @@ -205,15 +207,15 @@ extension SafariProtection { return true } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+UserRules) - addRules.onCbReloaded; self is missing!") + LOG.error("addRules.onCbReloaded; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+UserRules) - addRules.onCbReloaded; Error reloading CBs when adding \(rules.count) rules for type=\(type), override=\(override); Error: \(error)") + LOG.error("addRules.onCbReloaded; Error reloading CBs when adding \(rules.count) rules for type=\(type), override=\(override); Error: \(error)") } else { - Logger.logInfo("(SafariProtection+UserRules) - addRules.onCbReloaded; Successfully reloaded CBs after adding \(rules.count) rules for type=\(type), override=\(override)") + LOG.info("addRules.onCbReloaded; Successfully reloaded CBs after adding \(rules.count) rules for type=\(type), override=\(override)") } self.completionQueue.async { onCbReloaded?(error) } } @@ -233,15 +235,15 @@ extension SafariProtection { return true } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+UserRules) - setRules.onCbReloaded; self is missing!") + LOG.error("setRules.onCbReloaded; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+UserRules) - setRules.onCbReloaded; Error reloading CBs when setting \(rules.count) rules for type=\(type); Error: \(error)") + LOG.error("setRules.onCbReloaded; Error reloading CBs when setting \(rules.count) rules for type=\(type); Error: \(error)") } else { - Logger.logInfo("(SafariProtection+UserRules) - setRules.onCbReloaded; Successfully reloaded CBs after setting \(rules.count) rules for type=\(type)") + LOG.info("setRules.onCbReloaded; Successfully reloaded CBs after setting \(rules.count) rules for type=\(type)") } self.completionQueue.async { onCbReloaded?(error) } } @@ -250,7 +252,7 @@ extension SafariProtection { public func modifyRule(_ oldRuleText: String, _ newRule: UserRule, for type: SafariUserRuleType, onCbReloaded: ((Error?) -> Void)?) throws { try workingQueue.sync { - Logger.logInfo("(SafariProtection+UserRules) - modifyRule; Modifying old rule=\(oldRuleText) to new rule=\(newRule)") + LOG.info("Modifying old rule=\(oldRuleText) to new rule=\(newRule)") let provider = getProvider(for: type) try executeBlockAndReloadCbs { @@ -258,15 +260,15 @@ extension SafariProtection { return true } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+UserRules) - modifyRule.onCbReloaded; self is missing!") + LOG.error("modifyRule.onCbReloaded; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+UserRules) - modifyRule.onCbReloaded; Error reloading CBs when modifying rule=\(oldRuleText) to \(newRule) for type=\(type); Error: \(error)") + LOG.error("modifyRule.onCbReloaded; Error reloading CBs when modifying rule=\(oldRuleText) to \(newRule) for type=\(type); Error: \(error)") } else { - Logger.logInfo("(SafariProtection+UserRules) - modifyRule.onCbReloaded; Successfully reloaded CBs after modifying rule=\(oldRuleText) to \(newRule) for type=\(type)") + LOG.info("modifyRule.onCbReloaded; Successfully reloaded CBs after modifying rule=\(oldRuleText) to \(newRule) for type=\(type)") } self.completionQueue.async { onCbReloaded?(error) } } @@ -275,7 +277,7 @@ extension SafariProtection { public func turnRules(_ rules: [String], on: Bool, for type: SafariUserRuleType, onCbReloaded: ((Error?) -> Void)?) { workingQueue.sync { - Logger.logInfo("(SafariProtection+UserRules) - turnRules; Turning \(rules.count) rules on=\(on) for type=\(type)") + LOG.info("Turning \(rules.count) rules on=\(on) for type=\(type)") let provider = getProvider(for: type) executeBlockAndReloadCbs { @@ -285,15 +287,15 @@ extension SafariProtection { return true } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+UserRules) - turnRules.onCbReloaded; self is missing!") + LOG.error("turnRules.onCbReloaded; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+UserRules) - turnRules.onCbReloaded; Error reloading CBs when turning \(rules.count) rules on=\(on) for type=\(type); Error: \(error)") + LOG.error("turnRules.onCbReloaded; Error reloading CBs when turning \(rules.count) rules on=\(on) for type=\(type); Error: \(error)") } else { - Logger.logInfo("(SafariProtection+UserRules) - turnRules.onCbReloaded; Successfully reloaded CBs after turning \(rules.count) rules on=\(on) for type=\(type)") + LOG.info("turnRules.onCbReloaded; Successfully reloaded CBs after turning \(rules.count) rules on=\(on) for type=\(type)") } self.completionQueue.async { onCbReloaded?(error) } } @@ -302,7 +304,7 @@ extension SafariProtection { public func removeRule(withText ruleText: String, for type: SafariUserRuleType, onCbReloaded: ((Error?) -> Void)?) throws { try workingQueue.sync { - Logger.logInfo("(SafariProtection+UserRules) - removeRule; Removing rule=\(ruleText) for type=\(type)") + LOG.info("Removing rule=\(ruleText) for type=\(type)") let provider = getProvider(for: type) try executeBlockAndReloadCbs { @@ -310,15 +312,15 @@ extension SafariProtection { return true } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+UserRules) - removeRule.onCbReloaded; self is missing!") + LOG.error("removeRule.onCbReloaded; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+UserRules) - removeRule.onCbReloaded; Error reloading CBs when removing rule=\(ruleText) for type=\(type); Error: \(error)") + LOG.error("removeRule.onCbReloaded; Error reloading CBs when removing rule=\(ruleText) for type=\(type); Error: \(error)") } else { - Logger.logInfo("(SafariProtection+UserRules) - removeRule.onCbReloaded; Successfully reloaded CBs after removing rule=\(ruleText) for type=\(type)") + LOG.info("removeRule.onCbReloaded; Successfully reloaded CBs after removing rule=\(ruleText) for type=\(type)") } self.completionQueue.async { onCbReloaded?(error) } } @@ -327,7 +329,7 @@ extension SafariProtection { public func removeRules(_ rules: [String], for type: SafariUserRuleType, onCbReloaded: ((Error?) -> Void)?) { workingQueue.sync { - Logger.logInfo("(SafariProtection+UserRules) - removeRules; Removing \(rules.count) rules for type=\(type)") + LOG.info("Removing \(rules.count) rules for type=\(type)") let provider = getProvider(for: type) executeBlockAndReloadCbs { @@ -337,15 +339,15 @@ extension SafariProtection { return true } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+UserRules) - removeRules.onCbReloaded; self is missing!") + LOG.error("removeRules.onCbReloaded; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+UserRules) - removeRules.onCbReloaded; Error reloading CBs when removing \(rules.count) rules for type=\(type); Error: \(error)") + LOG.error("removeRules.onCbReloaded; Error reloading CBs when removing \(rules.count) rules for type=\(type); Error: \(error)") } else { - Logger.logInfo("(SafariProtection+UserRules) - removeRules.onCbReloaded; Successfully reloaded CBs after removing \(rules.count) rules for type=\(type)") + LOG.info("removeRules.onCbReloaded; Successfully reloaded CBs after removing \(rules.count) rules for type=\(type)") } self.completionQueue.async { onCbReloaded?(error) } } @@ -365,15 +367,15 @@ extension SafariProtection { return true } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+UserRules) - removeAllRules.onCbReloaded; self is missing!") + LOG.error("removeAllRules.onCbReloaded; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+UserRules) - removeAllRules.onCbReloaded; Error reloading CBs when removing all rules for type=\(type); Error: \(error)") + LOG.error("removeAllRules.onCbReloaded; Error reloading CBs when removing all rules for type=\(type); Error: \(error)") } else { - Logger.logInfo("(SafariProtection+UserRules) - removeAllRules.onCbReloaded; Successfully reloaded CBs after removing all rules for type=\(type)") + LOG.info("removeAllRules.onCbReloaded; Successfully reloaded CBs after removing all rules for type=\(type)") } self.completionQueue.async { onCbReloaded?(error) } } @@ -382,7 +384,7 @@ extension SafariProtection { public func removeAllUserRulesAssociatedWith(domain: String, onCbReloaded: ((Error?) -> Void)?) { workingQueue.sync { - Logger.logInfo("(SafariProtection+UserRules) - removeAllUserRulesAssociatedWithDomain; Removing all rules for type=\(domain)") + LOG.info("Removing all rules for type=\(domain)") let provider = getProvider(for: .blocklist) executeBlockAndReloadCbs { @@ -394,15 +396,15 @@ extension SafariProtection { return true } onCbReloaded: { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection+UserRules) - removeAllUserRulesAssociatedWithDomain.onCbReloaded; self is missing!") + LOG.error("removeAllUserRulesAssociatedWithDomain.onCbReloaded; self is missing!") DispatchQueue.main.async { onCbReloaded?(CommonError.missingSelf) } return } if let error = error { - Logger.logError("(SafariProtection+UserRules) - removeAllUserRulesAssociatedWithDomain; Error reloading CBs when removing all rules for domain=\(domain); Error: \(error)") + LOG.error("removeAllUserRulesAssociatedWithDomain; Error reloading CBs when removing all rules for domain=\(domain); Error: \(error)") } else { - Logger.logInfo("(SafariProtection+UserRules) - removeAllUserRulesAssociatedWithDomain; Successfully reloaded CBs after removing all rules for type=\(domain)") + LOG.info("removeAllUserRulesAssociatedWithDomain; Successfully reloaded CBs after removing all rules for type=\(domain)") } self.completionQueue.async { onCbReloaded?(error) } } @@ -422,19 +424,19 @@ extension SafariProtection { // MARK: - Private methods private func addRuleInternal(_ rule: UserRule, for type: SafariUserRuleType, override: Bool) throws { - Logger.logInfo("(SafariProtection+UserRules) - addRuleInternal; Adding rule: \(rule); for type=\(type); override=\(override)") + LOG.info("Adding rule: \(rule); for type=\(type); override=\(override)") let provider = getProvider(for: type) try provider.add(rule: rule, override: override) } private func setRulesInternal(_ rules: [String], for type: SafariUserRuleType) { - Logger.logInfo("(SafariProtection+UserRules) - setRulesInternal; Setting \(rules.count) rules; for type=\(type)") + LOG.info("Setting \(rules.count) rules; for type=\(type)") let provider = self.getProvider(for: type) provider.set(rules: rules) } private func removeAllRulesInternal(for type: SafariUserRuleType) { - Logger.logInfo("(SafariProtection+UserRules) - removeAllRulesInternal; Removing all rules for type=\(type)") + LOG.info("Removing all rules for type=\(type)") let provider = getProvider(for: type) provider.removeAllRules() } diff --git a/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection.swift b/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection.swift index d0ff85d03..3c5c79ccf 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/SafariProtection.swift @@ -37,6 +37,8 @@ public typealias SafariProtectionProtocol = SafariProtectionFiltersProtocol & SafariProtectionBackgroundFetchProtocol & ResetableSafariProtectionAsyncProtocol +private let LOG = LoggerFactory.getLoggerWrapper(SafariProtection.self) + public final class SafariProtection: SafariProtectionProtocol { // MARK: - Internal variables @@ -82,7 +84,7 @@ public final class SafariProtection: SafariProtectionProtocol { userDefaults: UserDefaults, dnsBackgroundFetchUpdater: DnsBackgroundFetchUpdateProtocol? = nil) throws { - Logger.logInfo("(SafariProtection) - init start") + LOG.info("Init start") let services = try ServicesStorage(configuration: configuration, filterFilesDirectoryUrl: filterFilesDirectoryUrl, @@ -101,7 +103,7 @@ public final class SafariProtection: SafariProtectionProtocol { self.converterHelper = WebExtensionHelpers() self.dnsBackgroundFetchUpdater = dnsBackgroundFetchUpdater - Logger.logInfo("(SafariProtection) - init end") + LOG.info("Init end") } // Initializer for tests @@ -134,12 +136,12 @@ public final class SafariProtection: SafariProtectionProtocol { public func reset(withReloadCB: Bool, _ onResetFinished: @escaping (Error?) -> Void) { workingQueue.async { [weak self] in guard let self = self else { - Logger.logError("(SafariProtection) - reset; self is missing!") + LOG.error("Self is missing!") DispatchQueue.main.async { onResetFinished(CommonError.missingSelf) } return } - Logger.logInfo("(SafariProtection) - reset start") + LOG.info("Reset start") //Update config with default configuration self.configuration.updateConfig(with: self.defaultConfiguration) @@ -155,21 +157,21 @@ public final class SafariProtection: SafariProtectionProtocol { group.wait() guard filtersError == nil else { - Logger.logError("(SafariProtection) - reset; Error reseting filters service; Error: \(filtersError!)") + LOG.error("Error reseting filters service; Error: \(filtersError!)") self.completionQueue.async { onResetFinished(filtersError) } return } do { - Logger.logInfo("(SafariProtection) - reset; filters service was reset") + LOG.info("Filters service was reset") try self.safariManagers.reset() - Logger.logInfo("(SafariProtection) - reset; user rules managers were reset") + LOG.info("User rules managers were reset") try self.cbStorage.reset() - Logger.logInfo("(SafariProtection) - reset; CB storage was reset") + LOG.info("CB storage was reset") } catch { - Logger.logError("(SafariProtection) - reset; Error reseting one of the service; Error: \(error)") + LOG.error("Error reseting one of the service; Error: \(error)") self.completionQueue.async { onResetFinished(error) } return } @@ -180,9 +182,9 @@ public final class SafariProtection: SafariProtectionProtocol { self.reloadContentBlockers { error in if let error = error { - Logger.logError("(SafariProtection) - reset; Error reloading CBs after reset; Error: \(error)") + LOG.error("Error reloading CBs after reset; Error: \(error)") } else { - Logger.logInfo("(SafariProtection) - reset; Successfully reloaded CB after reset") + LOG.info("Successfully reloaded CB after reset") } self.completionQueue.async { onResetFinished(error) } } @@ -213,7 +215,7 @@ public final class SafariProtection: SafariProtectionProtocol { BackgroundTaskExecutor.executeAsynchronousTask("SafariProtection.reloadContentBlockers") { [weak self] onTaskFinished in self?.cbQueue.async { [weak self] in guard let self = self else { - Logger.logError("(SafariProtection) - reloadContentBlockers; self is missing!") + LOG.error("Self is missing!") onCbReloaded(CommonError.missingSelf) onTaskFinished() return @@ -224,7 +226,7 @@ public final class SafariProtection: SafariProtectionProtocol { try self.cbStorage.save(converterResults: convertedfilters) } catch { - Logger.logError("(SafariProtection) - createNewCbJsonsAndReloadCbs; Error converting filters: \(error)") + LOG.error("Error converting filters: \(error)") self.workingQueue.sync { onCbReloaded(error) onTaskFinished() @@ -239,7 +241,7 @@ public final class SafariProtection: SafariProtectionProtocol { self.cbService.updateContentBlockers { [weak self] error in guard let self = self else { - Logger.logError("(SafariProtection) - reloadContentBlockers; self is missing!") + LOG.error("Self is missing!") self?.workingQueue.sync { onCbReloaded(CommonError.missingSelf) onTaskFinished() diff --git a/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/ServicesStorage.swift b/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/ServicesStorage.swift index e417f62a8..d8c94fc53 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/ServicesStorage.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/SafariProtection/ServicesStorage.swift @@ -28,6 +28,8 @@ protocol ServicesStorageProtocol { var converter: FiltersConverterServiceProtocol { get } } +private let LOG = LoggerFactory.getLoggerWrapper(ServicesStorage.self) + final class ServicesStorage: ServicesStorageProtocol { let configuration: SafariConfigurationProtocol @@ -44,7 +46,7 @@ final class ServicesStorage: ServicesStorageProtocol { userDefaults: UserDefaults, jsonStorageUrl: URL) throws { - Logger.logInfo("(ServicesStorage) - init start") + LOG.info("Init start") let filterFilesStorage = try FilterFilesStorage(filterFilesDirectoryUrl: filterFilesDirectoryUrl) try filterFilesStorage.unzipPredefinedFiltersIfNeeded() @@ -82,6 +84,6 @@ final class ServicesStorage: ServicesStorageProtocol { filtersConverter: filtersConverter ) - Logger.logInfo("(ServicesStorage) - init end") + LOG.info("Init end") } } diff --git a/AdGuardSDK/AdGuardSDK/Safari/UserRules/SafariUserRulesManagersProvider.swift b/AdGuardSDK/AdGuardSDK/Safari/UserRules/SafariUserRulesManagersProvider.swift index 593e65d47..33aacdbd0 100644 --- a/AdGuardSDK/AdGuardSDK/Safari/UserRules/SafariUserRulesManagersProvider.swift +++ b/AdGuardSDK/AdGuardSDK/Safari/UserRules/SafariUserRulesManagersProvider.swift @@ -24,6 +24,8 @@ public protocol SafariUserRulesManagersProviderProtocol: ResetableSyncProtocol { var invertedAllowlistRulesManager: UserRulesManagerProtocol { get } } +private let LOG = LoggerFactory.getLoggerWrapper(SafariUserRulesManagersProvider.self) + final public class SafariUserRulesManagersProvider: SafariUserRulesManagersProviderProtocol { private(set) lazy public var blocklistRulesManager: UserRulesManagerProtocol = { let storage = SafariUserRulesStorage(userDefaults: userDefaultsStorage, rulesType: .blocklist) @@ -51,12 +53,12 @@ final public class SafariUserRulesManagersProvider: SafariUserRulesManagersProvi } public func reset() throws { - Logger.logInfo("(UserRulesManagersProvider) - reset start") + LOG.info("Reset start") try blocklistRulesManager.reset() try allowlistRulesManager.reset() try invertedAllowlistRulesManager.reset() - Logger.logInfo("(UserRulesManagersProvider) - reset; Successfully reset all user rules managers") + LOG.info("Successfully reset all user rules managers") } } diff --git a/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/BackgroundTaskExecutor.swift b/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/BackgroundTaskExecutor.swift index faba75604..c5bbbbb4a 100644 --- a/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/BackgroundTaskExecutor.swift +++ b/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/BackgroundTaskExecutor.swift @@ -17,6 +17,9 @@ // import Foundation +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(BackgroundTaskExecutor.self) /// This object is responsible for executing tasks that can be continued in background /// Usually iOS gives us 30 seconds to complete such tasks @@ -27,7 +30,7 @@ public final class BackgroundTaskExecutor { ProcessInfo().performExpiringActivity(withReason: reason) { expired in if expired { // TODO: this does not help much since iOS will still kill the app if the task is still in progress. - Logger.logInfo("(BackgroundTaskExecutor) - executeSynchronousTask; Task with reason=\(reason) has expired") + LOG.info("Task with reason=\(reason) has expired") } else { blockToExecute() } @@ -40,9 +43,9 @@ public final class BackgroundTaskExecutor { ProcessInfo().performExpiringActivity(withReason: reason) { expired in if expired { // TODO: this does not help much since iOS will still kill the app if the task is still in progress. - Logger.logInfo("(BackgroundTaskExecutor) - executeAsynchronousTask; Task with reason=\(reason) has expired") + LOG.info("Task with reason=\(reason) has expired") } else { - Logger.logInfo("(BackgroundTaskExecutor) - executeAsynchronousTask; Task with reason=\(reason) has started") + LOG.info("Task with reason=\(reason) has started") let group = DispatchGroup() group.enter() @@ -51,7 +54,7 @@ public final class BackgroundTaskExecutor { } group.wait() - Logger.logInfo("(BackgroundTaskExecutor) - executeAsynchronousTask; Task with reason=\(reason) has finished") + LOG.info("Task with reason=\(reason) has finished") } } #endif diff --git a/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/FilterFilesStorage.swift b/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/FilterFilesStorage.swift index 66ea07da9..681a856f7 100644 --- a/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/FilterFilesStorage.swift +++ b/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/FilterFilesStorage.swift @@ -17,6 +17,7 @@ // import Foundation +import SharedAdGuardSDK public protocol CustomFilterFilesStorageProtocol: ResetableSyncProtocol { /** @@ -78,6 +79,8 @@ public protocol FilterFilesStorageProtocol: CustomFilterFilesStorageProtocol { func saveFilter(withId id: Int, filterContent: String) throws } +private let LOG = LoggerFactory.getLoggerWrapper(FilterFilesStorage.self) + /* This class manages filters text files */ public final class FilterFilesStorage: FilterFilesStorageProtocol { @@ -94,11 +97,11 @@ public final class FilterFilesStorage: FilterFilesStorageProtocol { // MARK: - Initialization public init(filterFilesDirectoryUrl: URL) throws { - Logger.logInfo("(FilterFilesStorage) - init start; filterFilesDirectoryUrl=\(filterFilesDirectoryUrl)") + LOG.info("filterFilesDirectoryUrl=\(filterFilesDirectoryUrl)") // We are trying to create directory if passed URL is not a valid directory if !filterFilesDirectoryUrl.isDirectory { - Logger.logInfo("(FilterFilesStorage) - creating a new filter files directory") + LOG.info("Creating a new filter files directory") try fileManager.createDirectory(at: filterFilesDirectoryUrl, withIntermediateDirectories: true, attributes: nil) } @@ -108,35 +111,35 @@ public final class FilterFilesStorage: FilterFilesStorageProtocol { // MARK: - Public methods public func updateFilter(withId id: Int, onFilterUpdated: @escaping (Error?) -> Void) { - Logger.logInfo("(FilterFilesStorage) - update filter \(id)") + LOG.info("Update filter \(id)") let filterFileUrl = urlForFilter(withId: id) downloadFilter(withUrl: filterFileUrl, filterId: id, onFilterDownloaded: onFilterUpdated) } public func updateCustomFilter(withId id: Int, subscriptionUrl: URL, onFilterUpdated: @escaping (Error?) -> Void) { - Logger.logInfo("(FilterFilesStorage) - update custom filter \(id) from \(subscriptionUrl)") + LOG.info("Update custom filter \(id) from \(subscriptionUrl)") downloadFilter(withUrl: subscriptionUrl, filterId: id, onFilterDownloaded: onFilterUpdated) } public func getFilterContentForFilter(withId id: Int) -> String? { - Logger.logDebug("(FilterFilesStorage) - get filter \(id) content") + LOG.debug("Get filter \(id) content") let fileUrl = fileUrlForFilter(withId: id) guard let content = try? String.init(contentsOf: fileUrl, encoding: .utf8) else { - Logger.logError("(FilterFilesStorage) - getFilterContentForFilter error. Can not read filter with url: \(fileUrl)") + LOG.error("getFilterContentForFilter error. Can not read filter with url: \(fileUrl)") // try to get presaved filter file if let presavedFilterFileUrl = defaultFilteUrlForFilter(withId: id), let content = try? String.init(contentsOf: presavedFilterFileUrl, encoding: .utf8) { - Logger.logInfo("(FilterFilesStorage) - return default filter for filter with id=\(id)") + LOG.info("Return default filter for filter with id=\(id)") return content } - Logger.logDebug("(FilterFilesStorage) - filter \(id) not found") + LOG.debug("Filter \(id) not found") return nil } - Logger.logDebug("(FilterFilesStorage) - filter \(id) content length is \(content.utf8.count)") + LOG.debug("Filter \(id) content length is \(content.utf8.count)") return content } @@ -152,14 +155,14 @@ public final class FilterFilesStorage: FilterFilesStorageProtocol { } public func saveFilter(withId id: Int, filterContent: String) throws { - Logger.logInfo("(FilterFilesStorage) - save filter \(id), content length is \(filterContent.utf8.count)") + LOG.info("Save filter \(id), content length is \(filterContent.utf8.count)") let filterFileUrl = fileUrlForFilter(withId: id) try filterContent.write(to: filterFileUrl, atomically: true, encoding: .utf8) - Logger.logInfo("(FilterFilesStorage) - filter \(id) has been saved to \(filterFileUrl)") + LOG.info("Filter \(id) has been saved to \(filterFileUrl)") } public func deleteFilter(withId id: Int) throws { - Logger.logInfo("(FilterFilesStorage) - delete filter \(id)") + LOG.info("Delete filter \(id)") let filterFileUrl = fileUrlForFilter(withId: id) try fileManager.removeItem(at: filterFileUrl) } @@ -169,7 +172,7 @@ public final class FilterFilesStorage: FilterFilesStorageProtocol { } public func reset() throws { - Logger.logInfo("(FilterFilesStorage) - reset start") + LOG.info("Reset start") // Delete all custom filters files let filtersUrls = try fileManager.contentsOfDirectory(at: filterFilesDirectoryUrl, includingPropertiesForKeys: nil, options: []) @@ -181,13 +184,13 @@ public final class FilterFilesStorage: FilterFilesStorageProtocol { try fileManager.removeItem(at: filterUrl) } } - Logger.logInfo("(FilterFilesStorage) - reset; Successfully deleted directory with filters") + LOG.info("Successfully deleted directory with filters") } // MARK: - Private methods private func downloadFilter(withUrl url: URL, filterId: Int, onFilterDownloaded: @escaping (Error?) -> Void) { - Logger.logDebug("(FilterFilesStorage) - download \(filterId) from \(url)") + LOG.debug("Download \(filterId) from \(url)") let filterFileUrl = fileUrlForFilter(withId: filterId) filtersDownloadQueue.async { @@ -197,7 +200,7 @@ public final class FilterFilesStorage: FilterFilesStorageProtocol { onFilterDownloaded(nil) } catch { - Logger.logError("(FilterFilesStorage) - downloadFilter - download error: \(error)") + LOG.error("Download error: \(error)") onFilterDownloaded(error) } } diff --git a/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/Logger/Logger.swift b/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/Logger/Logger.swift deleted file mode 100644 index c6461dccf..000000000 --- a/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/Logger/Logger.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// This file is part of Adguard for iOS (https://github.com/AdguardTeam/AdguardForiOS). -// Copyright © Adguard Software Limited. All rights reserved. -// -// Adguard for iOS is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Adguard for iOS is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Adguard for iOS. If not, see . -// - -import Foundation - -public typealias LogMessage = (_ message: String) -> Void - -public final class Logger { - public static var logInfo: LogMessage = { _ in } - public static var logError: LogMessage = { _ in } - public static var logDebug: LogMessage = { _ in } -} diff --git a/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/Logger/LoggerFactory.swift b/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/Logger/LoggerFactory.swift new file mode 100644 index 000000000..f2caf5963 --- /dev/null +++ b/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/Logger/LoggerFactory.swift @@ -0,0 +1,16 @@ +public class LoggerFactory : NSObject { + + @objc + public static func getLoggerWrapper(_ label: String) -> LoggerWrapper { + return LoggerWrapper(label) + } + + @objc + public static func objcGetLoggerWrapper(_ clazz: AnyObject.Type) -> LoggerWrapper { + return LoggerWrapper("\(clazz)") + } + + public static func getLoggerWrapper(_ clazz: Any.Type) -> LoggerWrapper { + return LoggerWrapper("\(clazz)") + } +} diff --git a/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/Logger/LoggerWrapper.swift b/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/Logger/LoggerWrapper.swift new file mode 100644 index 000000000..1568c54d4 --- /dev/null +++ b/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/Logger/LoggerWrapper.swift @@ -0,0 +1,66 @@ +import Foundation +import SwiftyBeaver + +/// Logger with specified label +public final class LoggerWrapper : NSObject { + @objc + let label: String + + @objc + init(_ label: String) { + self.label = label + super.init() + } + @objc + public func info(_ message: String?, _ file: String = #file, _ function: String = #function, line: Int = #line, customLabel: String? = nil) { + guard let message = message else { return } + + SwiftyBeaver.info(message, file, function, line: line, context: label) + } + @objc + public func debug(_ message: String?, _ file: String = #file, _ function: String = #function, line: Int = #line, customLabel: String? = nil) { + guard let message = message else { return } + + SwiftyBeaver.debug(message, file, function, line: line, context: label) + } + @objc + public func warn(_ message: String?, _ file: String = #file, _ function: String = #function, line: Int = #line, customLabel: String? = nil) { + guard let message = message else { return } + + SwiftyBeaver.warning(message, file, function, line: line, context: label) + } + @objc + public func error(_ message: String?, _ file: String = #file, _ function: String = #function, line: Int = #line, customLabel: String? = nil) { + guard let message = message else { return } + + SwiftyBeaver.error(message, file, function, line: line, context: label) + } + + + + // Static functions to call them when a logger shouldn't be created + @objc + public static func info(_ label: String, _ message: String?, _ file: String = #file, _ function: String = #function, line: Int = #line) { + guard let message = message else { return } + + SwiftyBeaver.info(message, file, function, line: line, context: label) + } + @objc + public static func debug(_ label: String, _ message: String?, _ file: String = #file, _ function: String = #function, line: Int = #line) { + guard let message = message else { return } + + SwiftyBeaver.debug(message, file, function, line: line, context: label) + } + @objc + public static func warn(_ label: String, _ message: String?, _ file: String = #file, _ function: String = #function, line: Int = #line) { + guard let message = message else { return } + + SwiftyBeaver.warning(message, file, function, line: line, context: label) + } + @objc + public static func error(_ label: String, _ message: String?, _ file: String = #file, _ function: String = #function, line: Int = #line) { + guard let message = message else { return } + + SwiftyBeaver.error(message, file, function, line: line, context: label) + } +} diff --git a/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/NetworkingStack/RequestSender.swift b/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/NetworkingStack/RequestSender.swift index 5c23f09ba..8e8605149 100644 --- a/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/NetworkingStack/RequestSender.swift +++ b/AdGuardSDK/AdGuardSDK/SharedAdGuardSDK/NetworkingStack/RequestSender.swift @@ -17,6 +17,7 @@ // import Foundation +import SharedAdGuardSDK // MARK: - RequestConfig @@ -55,6 +56,8 @@ public protocol RequestSenderProtocol { // MARK: - RequestSender +private let LOG = LoggerFactory.getLoggerWrapper(RequestSender.self) + /** This class is responsible for sending requests `send` method accepts `requestConfig` with `Parser` so it knows @@ -85,7 +88,7 @@ public final class RequestSender: RequestSenderProtocol{ #else // Process HTTP requests in background ProcessInfo().performExpiringActivity(withReason: "Sending HTTP request") { [weak self, group] expired in - Logger.logDebug("Sending request with URL = \(requestConfig.request.urlRequest?.url?.absoluteString ?? "nil"); expired = \(expired)") + LOG.debug("Sending request with URL = \(requestConfig.request.urlRequest?.url?.absoluteString ?? "nil"); expired = \(expired)") group.enter() self?.requestQueue.async { @@ -107,14 +110,14 @@ public final class RequestSender: RequestSenderProtocol{ private func sendInternal(requestConfig: RequestConfig, completion: @escaping (Result) -> Void) where Parser : ParserProtocol { guard let urlRequest = requestConfig.request.urlRequest else { let error = RequestSenderError.stringToUrlError - Logger.logError("Error: \(error)") + LOG.error("Error: \(error)") completion(.error(error)) return } let task = session.dataTask(with: urlRequest) { (data: Data?, response: URLResponse?, error: Error?) in if let error = error { - Logger.logError("Error: \(error)") + LOG.error("Error: \(error)") completion(.error(error)) return } @@ -122,7 +125,7 @@ public final class RequestSender: RequestSenderProtocol{ let parsedModel: Parser.Model = requestConfig.parser.parse(data: data, response: response) else { let error = RequestSenderError.receivedDataParsingError - Logger.logError(error.localizedDescription) + LOG.error(error.localizedDescription) completion(.error(error)) return } diff --git a/AdguardExtension/ActionExtension/ActionExtension-Bridging-Header.h b/AdguardExtension/ActionExtension/ActionExtension-Bridging-Header.h index c71f0c25c..5ab611d48 100644 --- a/AdguardExtension/ActionExtension/ActionExtension-Bridging-Header.h +++ b/AdguardExtension/ActionExtension/ActionExtension-Bridging-Header.h @@ -23,12 +23,10 @@ #import "ACNNetworking.h" #import "ACSSystemUtils.h" #import "ADProductInfo.h" -#import "DDLogMacros.h" #import "Reachability.h" #import "APCommonSharedResources.h" #import "ABECRequest.h" #import "ADLocales.h" -#import "ACLLogger.h" #import "NSString+Utils.h" #endif /* ActionExtension_Bridging_Header_h */ diff --git a/AdguardExtension/ActionExtension/ActionExtensionLoaderViewController.swift b/AdguardExtension/ActionExtension/ActionExtensionLoaderViewController.swift index d8979ac8b..38064a016 100644 --- a/AdguardExtension/ActionExtension/ActionExtensionLoaderViewController.swift +++ b/AdguardExtension/ActionExtension/ActionExtensionLoaderViewController.swift @@ -17,9 +17,13 @@ // import UIKit +import SharedAdGuardSDK /// This screen is needed to provide a model for `ActionExtensionTableController` /// If any error is occured it displays it + +private let LOG = LoggerFactory.getLoggerWrapper(ActionExtensionLoaderViewController.self) + final class ActionExtensionLoaderViewController: UIViewController { // MARK: - UI Elements @@ -42,7 +46,7 @@ final class ActionExtensionLoaderViewController: UIViewController { activityIndicator.startAnimating() - // FIXME: do not stop ui thread. + // FIXME: do not stop ui thread. migrateIfNeeded() configuration.systemAppearenceIsDark = systemStyleIsDark @@ -60,8 +64,12 @@ final class ActionExtensionLoaderViewController: UIViewController { let isSafariProtectionEnabled = self.isSafariProtectionEnabled(for: context.domain) self.modelToPass = ActionExtensionTableController.Model(context: context, isSafariProtectionEnabled: isSafariProtectionEnabled) self.performSegue(withIdentifier: self.segueId, sender: self) - case .failure(let error): - self.receivedError(error: error) + case .error(let error): + if let error = error as? ContextProvider.ContextError { + self.receivedError(error: error) + } else { + LOG.error("Can't cast error as 'ContextProvider.ContextError': \(error)") + } } } } @@ -122,7 +130,7 @@ final class ActionExtensionLoaderViewController: UIViewController { migration.migrate() } catch { - DDLogError("(ActionExtensionLoaderViewController) migration failed: \(error)") + LOG.error("Migration failed: \(error)") } } } diff --git a/AdguardExtension/ActionExtension/ContextProvider.swift b/AdguardExtension/ActionExtension/ContextProvider.swift index 012b549c3..70a6f8cd0 100644 --- a/AdguardExtension/ActionExtension/ContextProvider.swift +++ b/AdguardExtension/ActionExtension/ContextProvider.swift @@ -19,6 +19,7 @@ import CoreServices import Foundation import UIKit.UIImage +import SharedAdGuardSDK struct Context { let icon: UIImage? @@ -27,8 +28,11 @@ struct Context { let isJsInjectSupported: Bool } +private let LOG = LoggerFactory.getLoggerWrapper(ContextProvider.self) + /// This object is responsible for providing extension context /// It transforms `NSExtensionContext` into normal readable object `Context` + struct ContextProvider { enum ContextError: Error, CustomDebugStringConvertible { @@ -47,45 +51,45 @@ struct ContextProvider { self.favIconService = favIconService } - func process(context: NSExtensionContext?, onContextObtained: @escaping (Result) -> Void) { + func process(context: NSExtensionContext?, onContextObtained: @escaping (Result) -> Void) { let completionQueue = DispatchQueue.main guard let item = context?.inputItems.first as? NSExtensionItem, let itemProvider = item.attachments?.first else { - completionQueue.async { onContextObtained(.failure(ContextError.errorLoadingItem)) } + completionQueue.async { onContextObtained(.error(ContextError.errorLoadingItem)) } return } let type = String(kUTTypePropertyList) guard itemProvider.hasItemConformingToTypeIdentifier(type) else { - DDLogError("(ContextProvider) - process; Error: itemProvider doesn't conform to type \(type))") - completionQueue.async { onContextObtained(.failure(ContextError.typeInconformance)) } + LOG.error("Error: itemProvider doesn't conform to type \(type))") + completionQueue.async { onContextObtained(.error(ContextError.typeInconformance)) } return } itemProvider.loadItem(forTypeIdentifier: type, options: nil) { result, loadItemError in guard loadItemError == nil else { - DDLogError("(ContextProvider) - process; Error loading item: \(loadItemError!)") - completionQueue.async { onContextObtained(.failure(ContextError.errorLoadingItem)) } + LOG.error("Error loading item: \(loadItemError!)") + completionQueue.async { onContextObtained(.error(ContextError.errorLoadingItem)) } return } processDictionary(result, onContextObtained) } } - private func processDictionary(_ dict: NSSecureCoding?, _ onContextObtained: @escaping (Result) -> Void) { + private func processDictionary(_ dict: NSSecureCoding?, _ onContextObtained: @escaping (Result) -> Void) { let completionQueue = DispatchQueue.main guard let dictResult = dict as? [String: Any] else { - DDLogError("(ContextProvider) - process; Error result is not a valid dict. Results: \(String(describing: dict))") - completionQueue.async { onContextObtained(.failure(ContextError.typeInconformance)) } + LOG.error("Error result is not a valid dict. Results: \(String(describing: dict))") + completionQueue.async { onContextObtained(.error(ContextError.typeInconformance)) } return } guard let infoDict = dictResult[NSExtensionJavaScriptPreprocessingResultsKey] as? [String: Any] else { - DDLogError("(ContextProvider) - process; Can't get NSExtensionJavaScriptPreprocessingResultsKey. Results: \(dictResult)") - completionQueue.async { onContextObtained(.failure(ContextError.typeInconformance)) } + LOG.error("Can't get NSExtensionJavaScriptPreprocessingResultsKey. Results: \(dictResult)") + completionQueue.async { onContextObtained(.error(ContextError.typeInconformance)) } return } @@ -94,8 +98,8 @@ struct ContextProvider { let url = URL(string: urlString), let domain = url.host else { - DDLogError("(ContextProvider) - process; Error obtaining page url") - completionQueue.async { onContextObtained(.failure(ContextError.obtainDomain)) } + LOG.error("Error obtaining page url") + completionQueue.async { onContextObtained(.error(ContextError.obtainDomain)) } return } diff --git a/AdguardExtension/ActionExtension/ServicesInitializer.swift b/AdguardExtension/ActionExtension/ServicesInitializer.swift index f26c3911a..7e23a0c88 100644 --- a/AdguardExtension/ActionExtension/ServicesInitializer.swift +++ b/AdguardExtension/ActionExtension/ServicesInitializer.swift @@ -19,6 +19,8 @@ import SafariAdGuardSDK import SharedAdGuardSDK +private let LOG = LoggerFactory.getLoggerWrapper(ServicesInitializer.self) + /// Singleton to quikcly get different services objects and remove initialization logic from view controllers final class ServicesInitializer { @@ -38,14 +40,14 @@ final class ServicesInitializer { let appPath = Bundle.main.bundlePath as NSString let fullPath = appPath.appendingPathComponent("../../") as String guard let bundle = Bundle(path: fullPath), let path = bundle.path(forResource: "defaults", ofType: "plist") else { - DDLogError("(ServicesInitializer) - wrong appPath"); + LOG.error("Wrong appPath"); throw CommonError.missingFile(filename: fullPath) } if let defs = NSDictionary(contentsOfFile: path) as? [String: Any] { - DDLogInfo("(ServicesInitializer) - default.plist loaded!") + LOG.info("default.plist loaded!") resources.sharedDefaults().register(defaults: defs) } else { - DDLogError("(ServicesInitializer) - default.plist was not loaded.") + LOG.error("default.plist was not loaded.") throw CommonError.missingFile(filename: "default.plist") } @@ -87,21 +89,12 @@ final class ServicesInitializer { private static func setupLogger(_ resources: AESharedResourcesProtocol) { // Init Logger - ACLLogger.singleton()?.initLogger(resources.sharedAppLogsURL()) let isDebugLogs = resources.isDebugLogs - DDLogInfo("Start Action extension with log level: \(isDebugLogs ? "DEBUG" : "NORMAL")") - ACLLogger.singleton()?.logLevel = isDebugLogs ? ACLLDebugLevel : ACLLDefaultLevel - - Logger.logInfo = { msg in - DDLogInfo(msg) - } + LOG.info("Start Action extension with log level: \(isDebugLogs ? "DEBUG" : "NORMAL")") - Logger.logDebug = { msg in - DDLogDebug(msg) - } - - Logger.logError = { msg in - DDLogError(msg) - } + let logManager = LoggerManagerImpl(url: resources.sharedLogsURL()) + let logLevel: LogLevel = isDebugLogs ? .debug : .info + logManager.configure(logLevel) + LOG.info("initLogger \(logLevel)") } } diff --git a/AdguardExtension/AdGuardTodayExtension/AdGuardTodayExtension-Bridging-Header.h b/AdguardExtension/AdGuardTodayExtension/AdGuardTodayExtension-Bridging-Header.h index 3dda4fec7..b84263b46 100644 --- a/AdguardExtension/AdGuardTodayExtension/AdGuardTodayExtension-Bridging-Header.h +++ b/AdguardExtension/AdGuardTodayExtension/AdGuardTodayExtension-Bridging-Header.h @@ -3,13 +3,11 @@ #import "AESharedResources.h" #import "ACNNetworking.h" -#import "DDLogMacros.h" #import "ADProductInfo.h" #import "Reachability.h" #import "ABECRequest.h" #import "ADLocales.h" #import "APCommonSharedResources.h" -#import "ACLLogger.h" #import "NSString+Utils.h" #endif /* AdGuardTodayExtension_Bridging_Header_h */ diff --git a/AdguardExtension/AdGuardTodayExtension/ServiceInitializer.swift b/AdguardExtension/AdGuardTodayExtension/ServiceInitializer.swift index 2ef070105..39dabbfda 100644 --- a/AdguardExtension/AdGuardTodayExtension/ServiceInitializer.swift +++ b/AdguardExtension/AdGuardTodayExtension/ServiceInitializer.swift @@ -18,6 +18,7 @@ import SafariAdGuardSDK import DnsAdGuardSDK +import SharedAdGuardSDK protocol ServiceInitializerProtocol { var networkService: ACNNetworkingProtocol { get } @@ -27,8 +28,11 @@ protocol ServiceInitializerProtocol { var complexProtection: ComplexProtectionServiceProtocol { get } var dnsProvidersManager: DnsProvidersManagerProtocol { get } var activityStatistics: ActivityStatisticsProtocol { get } + var loggerManager: LoggerManager { get } } +private let LOG = LoggerFactory.getLoggerWrapper(ServiceInitializer.self) + final class ServiceInitializer: ServiceInitializerProtocol { let networkService: ACNNetworkingProtocol = ACNNetworking() let productInfo: ADProductInfoProtocol = ADProductInfo() @@ -38,28 +42,39 @@ final class ServiceInitializer: ServiceInitializerProtocol { let dnsProvidersManager: DnsProvidersManagerProtocol let activityStatistics: ActivityStatisticsProtocol - init(resources: AESharedResourcesProtocol) throws { - DDLogInfo("(TodayViewController) - init services start") + + private(set) var loggerManager: LoggerManager + + init?() { + let resources = AESharedResources() + self.loggerManager = LoggerManagerImpl(url: resources.sharedLogsURL()) + let logLevel: LogLevel = resources.isDebugLogs ? .debug : .info + loggerManager.configure(logLevel) + LOG.info("Init services start with logLevel \(logLevel)") let networkService = ACNNetworking() let productInfo = ADProductInfo() let purchaseService = PurchaseService(network: networkService, resources: resources, productInfo: productInfo) - let sharedStorageUrls = SharedStorageUrls() - DDLogInfo("(TodayViewController) - init safari protection service") + LOG.info("Init safari protection service") let safariConfiguration = SafariConfiguration( - resources: resources, + resources: resources, isProPurchased: purchaseService.isProPurchased ) - self.safariProtection = try SafariProtection( - configuration: safariConfiguration, - defaultConfiguration: safariConfiguration, - filterFilesDirectoryUrl: sharedStorageUrls.filtersFolderUrl, - dbContainerUrl: sharedStorageUrls.dbFolderUrl, - jsonStorageUrl: sharedStorageUrls.cbJsonsFolderUrl, - userDefaults: resources.sharedDefaults() - ) + do { + self.safariProtection = try SafariProtection( + configuration: safariConfiguration, + defaultConfiguration: safariConfiguration, + filterFilesDirectoryUrl: sharedStorageUrls.filtersFolderUrl, + dbContainerUrl: sharedStorageUrls.dbFolderUrl, + jsonStorageUrl: sharedStorageUrls.cbJsonsFolderUrl, + userDefaults: resources.sharedDefaults() + ) + } catch { + LOG.error("SafariProtection initialization failed \(error)") + return nil + } let networkSettings = NetworkSettingsService(resources: resources) @@ -74,9 +89,14 @@ final class ServiceInitializer: ServiceInitializerProtocol { isProPurchased: purchaseService.isProPurchased ) - DDLogInfo("(TodayViewController) - init dns protection service") + LOG.info("Init dns protection service") - self.dnsProvidersManager = try DnsProvidersManager(configuration: dnsConfiguration, userDefaults: resources.sharedDefaults(), networkUtils: NetworkUtils()) + do { + self.dnsProvidersManager = try DnsProvidersManager(configuration: dnsConfiguration, userDefaults: resources.sharedDefaults(), networkUtils: NetworkUtils()) + } catch { + LOG.error("DnsProvidersManager initialization failed \(error)") + return nil + } let nativeDnsSettingsManager = NativeDnsSettingsManager(networkSettingsService: networkSettings, dnsProvidersManager: dnsProvidersManager, configuration: configuration, resources: resources) @@ -97,10 +117,19 @@ final class ServiceInitializer: ServiceInitializerProtocol { // MARK: - ActivityStatistics - DDLogInfo("(TodayViewController) - init activity statistics service") + LOG.info("Init activity statistics service") - self.activityStatistics = try ActivityStatistics(statisticsDbContainerUrl: sharedStorageUrls.statisticsFolderUrl, readOnly: true) + do { + self.activityStatistics = try ActivityStatistics(statisticsDbContainerUrl: sharedStorageUrls.statisticsFolderUrl, readOnly: true) + } catch { + LOG.error("ActivityStatistics initialization failed \(error)") + return nil + } + + LOG.info("Init services end") + } - DDLogInfo("(TodayViewController) - init services end") + func setLoggerManager(_ loggerManager: LoggerManager) { + self.loggerManager = loggerManager } } diff --git a/AdguardExtension/AdGuardTodayExtension/TodayViewController.swift b/AdguardExtension/AdGuardTodayExtension/TodayViewController.swift index ebe6eeedb..b30027e2d 100644 --- a/AdguardExtension/AdGuardTodayExtension/TodayViewController.swift +++ b/AdguardExtension/AdGuardTodayExtension/TodayViewController.swift @@ -22,6 +22,8 @@ import SafariAdGuardSDK import SharedAdGuardSDK import DnsAdGuardSDK +private let LOG = LoggerFactory.getLoggerWrapper(TodayViewController.self) + class TodayViewController: UIViewController, NCWidgetProviding { @IBOutlet weak var height: NSLayoutConstraint! @@ -67,28 +69,22 @@ class TodayViewController: UIViewController, NCWidgetProviding { private var timer: Timer? - // MARK: View Controller lifecycle - required init?(coder: NSCoder) { - Self.initLogger(with: resources) - DDLogInfo("(TodayViewController) - init start") - - // Services initialising - do { - self.serviceInitializer = try ServiceInitializer(resources: resources) - } catch { - DDLogError("(TodayViewController) - init; error - \(error)") + guard let serviceInitializer = ServiceInitializer() else { + LOG.error("ServiceInitializer is missing") return nil } + LOG.info("Init start") + self.serviceInitializer = serviceInitializer super.init(coder: coder) - DDLogInfo("(TodayViewController) - init end") + LOG.info("Init end") } override func viewDidLoad() { super.viewDidLoad() - DDLogInfo("(TodayViewController) - viewDidLoad") + LOG.info("viewDidLoad") height.constant = extensionContext?.widgetMaximumSize(for: .compact).height ?? 110.0 @@ -100,12 +96,12 @@ class TodayViewController: UIViewController, NCWidgetProviding { // MARK: - NCWidgetProviding methods func widgetPerformUpdate(completionHandler: (@escaping (NCUpdateResult) -> Void)) { - DDLogInfo("(TodayViewController) - widgetPerformUpdate start") + LOG.info("widgetPerformUpdate start") setColorsToLabels() updateWidgetSafari() updateWidgetSystem() updateWidgetComplex() - DDLogInfo("(TodayViewController) - widgetPerformUpdate end") + LOG.info("widgetPerformUpdate end") completionHandler(NCUpdateResult.newData) } @@ -130,9 +126,9 @@ class TodayViewController: UIViewController, NCWidgetProviding { let enabled = sender.isOn serviceInitializer.complexProtection.switchSafariProtection(state: enabled, for: self) { (error) in if error != nil { - DDLogError("Error invalidating json from Today Extension") + LOG.error("Error invalidating json from Today Extension") } else { - DDLogInfo("Successfull invalidating of json from Today Extension") + LOG.info("Successfull invalidating of json from Today Extension") } } @@ -177,11 +173,11 @@ class TodayViewController: UIViewController, NCWidgetProviding { if let url = URL(string: openSystemProtectionUrl){ extensionContext?.open(url, completionHandler: { (success) in if !success { - DDLogError("Error redirecting to app from Today Extension") + LOG.error("Error redirecting to app from Today Extension") } }) } else { - DDLogError("Error redirecting to app from Today Extension") + LOG.error("Error redirecting to app from Today Extension") } } @@ -355,34 +351,11 @@ class TodayViewController: UIViewController, NCWidgetProviding { let averageElapsed = requestsNumber == 0 ? 0 : Double(elapsedSumm) / Double(requestsNumber) self.elapsedLabel.text = String.simpleSecondsFormatter(NSNumber(floatLiteral: averageElapsed)) - + // TODO: change this to use requestsLabelTxt/encryptedLabelTxt later (requires new localized string) self.complexStatisticsLabel.text = String(format: String.localizedString("widget_statistics"), requestsNumber, encryptedNumber) } } - - /// Initializes logger - private static func initLogger(with resources: AESharedResourcesProtocol) { - // TODO: refactor, everywhere is the same code - // Init Logger - ACLLogger.singleton()?.initLogger(resources.sharedAppLogsURL()) - - let isDebugLogs = resources.isDebugLogs - DDLogInfo("Start today extension with log level: \(isDebugLogs ? "DEBUG" : "Normal")") - ACLLogger.singleton()?.logLevel = isDebugLogs ? ACLLDebugLevel : ACLLDefaultLevel - - Logger.logInfo = { msg in - DDLogInfo(msg) - } - - Logger.logDebug = { msg in - DDLogDebug(msg) - } - - Logger.logError = { msg in - DDLogError(msg) - } - } } /// Themable colors for today extension diff --git a/AdguardExtension/Adguard-Bridging-Header.h b/AdguardExtension/Adguard-Bridging-Header.h index 8104ac02c..dbd984940 100644 --- a/AdguardExtension/Adguard-Bridging-Header.h +++ b/AdguardExtension/Adguard-Bridging-Header.h @@ -8,12 +8,10 @@ #import "ADProductInfo.h" #import "NSString+Utils.h" #import "ACDnsUtils.h" -#import "DDLogMacros.h" #import "Reachability.h" #import "ADLocales.h" #import "APCommonSharedResources.h" #import "ACNCidrRange.h" #import "ABECRequest.h" -#import "ACLLogger.h" #endif /* AdGuard_Bridging_Header_h */ diff --git a/AdguardExtension/Adguard.xcodeproj/project.pbxproj b/AdguardExtension/Adguard.xcodeproj/project.pbxproj index bb15fd613..15d82c79a 100644 --- a/AdguardExtension/Adguard.xcodeproj/project.pbxproj +++ b/AdguardExtension/Adguard.xcodeproj/project.pbxproj @@ -364,6 +364,206 @@ 24F67F5A26E778DB00ABF2BE /* SafariWebExtensionParametersParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24F67F5726E778DB00ABF2BE /* SafariWebExtensionParametersParser.swift */; }; 24F8A94D271DB62600ADA050 /* NetworkSettingsMigration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24CE2B83271DA4E700E169E7 /* NetworkSettingsMigration.swift */; }; 24FB8B1326EB9C330031ED4D /* UITraitEnvironment+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E86A9B626CBB591000B395F /* UITraitEnvironment+Utils.swift */; }; + 3D1EA6E927DA034C005E7153 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3D1EA6EA27DA034F005E7153 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3D1EA70F27DA2C03005E7153 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3D1EA71027DA2C06005E7153 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3D1EA71727DA2CCE005E7153 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3D1EA71827DA2CD0005E7153 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3D1EA71927DA2CEB005E7153 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3D1EA71A27DA2CED005E7153 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3D1EA71B27DA2D35005E7153 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3D1EA71C27DA2D37005E7153 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3D1EA72127DA3503005E7153 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3D1EA72227DA3506005E7153 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3D1EA72327DA3507005E7153 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3D1EA72527DA3539005E7153 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3D1EA72627DA353B005E7153 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3D1EA72727DA353C005E7153 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3D1EA72827DA353E005E7153 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3D1EA72927DA3594005E7153 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3D1EA72A27DA3596005E7153 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3D1EA72B27DA35B9005E7153 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3D1EA72C27DA35BB005E7153 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3D8EA81827D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3D8EA81927D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3D8EA81B27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3D8EA81C27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3D8EA81E27D0CEBA00F0172F /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3D8EA81F27D0CEBA00F0172F /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3D8EA83027D0CFD900F0172F /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3D8EA83127D0CFD900F0172F /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A24D27DF2B7400CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A24E27DF2B7500CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A24F27DF2D6C00CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A25027DF2D6D00CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A25127DF2EB000CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A25227DF2EB000CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A25327DF2EB100CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A25427DF2EB200CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A25527DF2EB200CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A25627DF2EB300CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A25727DF2EB600CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A25827DF2EB600CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A25927DF2EB700CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A25A27DF2EB700CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A25B27DF2EB800CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A25C27DF2EB900CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A25D27DF2EBE00CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A25E27DF2EBF00CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A25F27DF2EBF00CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A26027DF2EC000CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A26127DF2EC100CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A26227DF2EC200CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A26327DF2F7700CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A26427DF2F7800CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A26527DF2F7800CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A26627DF2F7900CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A26727DF2F7A00CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A26827DF2F7A00CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A26927DF2F7B00CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A26A27DF2F7C00CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A26B27DF2F7D00CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A26C27DF2F7D00CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A26D27DF2F7E00CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A26E27DF2F7F00CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A26F27DF2F8200CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A27027DF2F8300CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A27127DF2F8300CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A27227DF2F8400CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A27327DF2F8400CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A27427DF2F8500CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A27527DF2F8900CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A27627DF2F8A00CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A27727DF2F8A00CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A27827DF2F8B00CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A27927DF2F8B00CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A27A27DF2F8C00CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A27B27DF2FC500CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A27C27DF2FC600CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A27D27DF2FC600CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A27E27DF2FC700CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A27F27DF2FC800CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A28027DF2FC900CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A28127DF2FDF00CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A28227DF2FE100CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A28327DF2FE500CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A28427DF2FE700CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A28627DF2FEC00CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A28727DF304200CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A28827DF304300CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A28927DF308B00CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A28A27DF308D00CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A28B27DF309B00CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A28C27DF309C00CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A28D27DF30C900CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A28E27DF30CB00CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A28F27DF315F00CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A29027DF315F00CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A29127DF316100CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A29227DF316100CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A29327DF316200CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A29427DF316200CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A29527DF316600CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A29627DF316800CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A29727DF316A00CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A29827DF316B00CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A29927DF316B00CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A29A27DF316C00CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A29B27DF316C00CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A29C27DF316D00CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A29D27DF31AA00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A29E27DF31AB00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A29F27DF31AB00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2A027DF31AB00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2A127DF31AC00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2A227DF31AC00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2A327DF31AE00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2A427DF31AF00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2A527DF31AF00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2A627DF31B000CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2A827DF31B100CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2A927DF31B200CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2AC27DF31D200CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2AD27DF31D300CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2AE27DF31D300CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2AF27DF31D400CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2B027DF31D500CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2B127DF31D500CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2B227DF31DE00CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2B327DF31DF00CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2B427DF31DF00CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2B527DF31E000CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2B627DF31E100CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2B727DF31E200CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2B827DF329400CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A2B927DF329500CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A2BA27DF329800CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A2BC27DF329B00CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A2BE27DF32BD00CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A2BF27DF32BE00CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A2C027DF32D200CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2C127DF32D400CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2C227DF33C100CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A2C327DF33C200CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A2C427DF33C700CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2C527DF33C800CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A2C627DF33CD00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2C727DF33CE00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2C827DF33CE00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2C927DF33D100CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2CA27DF33D400CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2CB27DF33D600CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A2CF27DF351200CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A2D027DF36F900CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2D127DF370400CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2D227DF370400CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2D327DF370700CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2D427DF370700CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2D527DF370900CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2D627DF370900CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2D727DF370A00CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2D827DF370A00CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2D927DF370B00CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2DA27DF370B00CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2DB27DF370C00CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2DC27DF370D00CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2DD27DF370D00CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2DE27DF370F00CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2DF27DF370F00CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2E027DF371000CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2E127DF371100CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A2E227DF374700CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A2E527DF386B00CE8F68 /* LoggerManagerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D1EA6E227DA00C5005E7153 /* LoggerManagerExtensions.swift */; }; + 3DB3A2EF27DF387300CE8F68 /* LoggerManagerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D1EA6E227DA00C5005E7153 /* LoggerManagerExtensions.swift */; }; + 3DB3A2F027DF387400CE8F68 /* LoggerManagerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D1EA6E227DA00C5005E7153 /* LoggerManagerExtensions.swift */; }; + 3DB3A2FA27DF38C200CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A2FB27DF38C200CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A2FC27DF38F000CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A2FD27DF392A00CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A2FE27DF392B00CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A2FF27DF392C00CE8F68 /* LoggerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */; }; + 3DB3A30027DF392F00CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A30127DF393000CE8F68 /* LogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */; }; + 3DB3A30227DF393300CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A30327DF393500CE8F68 /* LogLevelExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */; }; + 3DB3A30427DF396100CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A30527DF396200CE8F68 /* LoggerManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */; }; + 3DB3A30627DF396500CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A30727DF396700CE8F68 /* ConsoleAppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */; }; + 3DB3A30827DF396900CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A30927DF396A00CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A30C27DF397300CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A30D27DF397600CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */; }; + 3DB3A30E27DF39F100CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A30F27DF39F200CE8F68 /* NativeLoggerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */; }; + 3DB3A31027DF3CA800CE8F68 /* AGLoggerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D1EA6D727D90969005E7153 /* AGLoggerExtensions.swift */; }; + 3DB3A31127DF3CA800CE8F68 /* AGLoggerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D1EA6D727D90969005E7153 /* AGLoggerExtensions.swift */; }; + 3DB3A31D27DF3CAF00CE8F68 /* AGLoggerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D1EA6D727D90969005E7153 /* AGLoggerExtensions.swift */; }; + 3DB3A32627DF3CB500CE8F68 /* AGLoggerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D1EA6D727D90969005E7153 /* AGLoggerExtensions.swift */; }; + 3DB3A32B27DF447800CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DB3A32C27DF447B00CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */; }; + 3DF1EB9527DFB592002D7B56 /* LoggerManagerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D1EA6E227DA00C5005E7153 /* LoggerManagerExtensions.swift */; }; 4020A90122C3C864009C188F /* MainNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4020A90022C3C863009C188F /* MainNavigationController.swift */; }; 494E0BBA26E7AF49005C21C4 /* SharedStorageUrls.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ED0B1A126C4334D00B0CE7B /* SharedStorageUrls.swift */; }; 494E0BBB26E7AF4A005C21C4 /* SharedStorageUrls.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ED0B1A126C4334D00B0CE7B /* SharedStorageUrls.swift */; }; @@ -417,12 +617,6 @@ 655A02311C6B7686000F00D7 /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; 655A02321C6B7686000F00D7 /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; 655A02331C6B7686000F00D7 /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; - 655A02341C6B7686000F00D7 /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; - 655A02351C6B7686000F00D7 /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; - 655A02361C6B7686000F00D7 /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; - 655A023D1C6B7686000F00D7 /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; - 655A023E1C6B7686000F00D7 /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; - 655A023F1C6B7686000F00D7 /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; 655A024C1C6B7686000F00D7 /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; 655A024D1C6B7686000F00D7 /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; 655A024E1C6B7686000F00D7 /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; @@ -462,7 +656,6 @@ 659886541CF74DE9003ECD1C /* NSException+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EE1C6B7686000F00D7 /* NSException+Utils.m */; }; 659886551CF74DE9003ECD1C /* ACNHttpUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01FE1C6B7686000F00D7 /* ACNHttpUtils.m */; }; 659886571CF74DE9003ECD1C /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; - 659886591CF74DE9003ECD1C /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; 6598865A1CF74DE9003ECD1C /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; 6598865B1CF74DE9003ECD1C /* ADLocations.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8C1BB9824C00F53F3B /* ADLocations.m */; }; 6598865E1CF74DE9003ECD1C /* ADProductInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8F1BB9824C00F53F3B /* ADProductInfo.m */; }; @@ -470,7 +663,6 @@ 6598866A1CF74DE9003ECD1C /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; 6598866E1CF74DE9003ECD1C /* NSURL+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F61C6B7686000F00D7 /* NSURL+Utils.m */; }; 659886711CF74DE9003ECD1C /* ACIOUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B21C6B7686000F00D7 /* ACIOUtils.m */; }; - 659886721CF74DE9003ECD1C /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; 6598867B1CF74DE9003ECD1C /* ACFFileUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01A51C6B7686000F00D7 /* ACFFileUtils.m */; }; 6598867C1CF74DE9003ECD1C /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; 659886801CF74DE9003ECD1C /* AEUILongLabelViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EBC2501BC2D25E00788D98 /* AEUILongLabelViewCell.m */; }; @@ -520,35 +712,22 @@ 65EC9CFD1BB9850300F53F3B /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 65E5A0991B8632F600319AA3 /* libz.tbd */; }; 65F398681B7B6A5300ABCD39 /* AdguardBlockingExtensionGeneral.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 65F3985E1B7B6A5300ABCD39 /* AdguardBlockingExtensionGeneral.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 65F3986E1B7C894000ABCD39 /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65F3986D1B7C894000ABCD39 /* SafariServices.framework */; }; - 7E06B66722FB1606006859AC /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; 7E06B66822FB1606006859AC /* ACIOUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B21C6B7686000F00D7 /* ACIOUtils.m */; }; 7E06B66922FB1606006859AC /* ADProductInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8F1BB9824C00F53F3B /* ADProductInfo.m */; }; - 7E06B66B22FB1606006859AC /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; 7E06B66C22FB1606006859AC /* ACSSystemUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02091C6B7686000F00D7 /* ACSSystemUtils.m */; }; - 7E06B66E22FB1606006859AC /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; 7E06B66F22FB1606006859AC /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; - 7E06B67022FB1606006859AC /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; 7E06B67122FB1606006859AC /* ACLExecuteBlockDelayed.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B81C6B7686000F00D7 /* ACLExecuteBlockDelayed.m */; }; 7E06B67222FB1606006859AC /* NSException+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EE1C6B7686000F00D7 /* NSException+Utils.m */; }; 7E06B67322FB1606006859AC /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; - 7E06B67422FB1606006859AC /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; 7E06B67522FB1606006859AC /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; 7E06B67622FB1606006859AC /* ACFFileUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01A51C6B7686000F00D7 /* ACFFileUtils.m */; }; - 7E06B67722FB1606006859AC /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - 7E06B67922FB1606006859AC /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; 7E06B67A22FB1606006859AC /* ACIOStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B01C6B7686000F00D7 /* ACIOStream.m */; }; 7E06B67B22FB1606006859AC /* NSURL+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F61C6B7686000F00D7 /* NSURL+Utils.m */; }; 7E06B67C22FB1606006859AC /* APCommonSharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = D05CA86C1F3B6455006DFD7F /* APCommonSharedResources.m */; }; - 7E06B67D22FB1606006859AC /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - 7E06B67E22FB1606006859AC /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; 7E06B67F22FB1606006859AC /* ADLocations.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8C1BB9824C00F53F3B /* ADLocations.m */; }; 7E06B68022FB1606006859AC /* NSDate+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EC1C6B7686000F00D7 /* NSDate+Utils.m */; }; - 7E06B68122FB1606006859AC /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; 7E06B68322FB1606006859AC /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; - 7E06B68422FB1606006859AC /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; 7E06B68522FB1606006859AC /* ACNHttpUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01FE1C6B7686000F00D7 /* ACNHttpUtils.m */; }; - 7E06B68622FB1606006859AC /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - 7E06B68722FB1606006859AC /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; 7E06B68822FB1606006859AC /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; 7E06B68922FB1606006859AC /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A020F1C6B7686000F00D7 /* Reachability.m */; settings = {COMPILER_FLAGS = "-w"; }; }; 7E06B68C22FB1606006859AC /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 65E5A0991B8632F600319AA3 /* libz.tbd */; }; @@ -722,28 +901,12 @@ 7E6081FB26D561CB00D778F4 /* UserNotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EF5C56E26C26D3A001851D6 /* UserNotificationService.swift */; }; 7E6081FC26D5625100D778F4 /* UIColorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F9116D212FFCD6006DF0D3 /* UIColorUtils.swift */; }; 7E6081FD26D5625100D778F4 /* UIColorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F9116D212FFCD6006DF0D3 /* UIColorUtils.swift */; }; - 7E6081FE26D562A100D778F4 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; - 7E6081FF26D562A200D778F4 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; - 7E60820326D562B600D778F4 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; - 7E60820426D562B700D778F4 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; - 7E60820526D562BB00D778F4 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; - 7E60820626D562BC00D778F4 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; 7E60820726D5630300D778F4 /* String+NSRange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 244419832614C1BC009555F3 /* String+NSRange.swift */; }; 7E60820826D5630300D778F4 /* String+NSRange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 244419832614C1BC009555F3 /* String+NSRange.swift */; }; - 7E60820926D5633000D778F4 /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; - 7E60820A26D5633000D778F4 /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; - 7E60820B26D5633D00D778F4 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; - 7E60820C26D5633E00D778F4 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; 7E60820D26D5634D00D778F4 /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; 7E60820E26D5634E00D778F4 /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; 7E60820F26D5635600D778F4 /* NSString+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F21C6B7686000F00D7 /* NSString+Utils.m */; }; 7E60821026D5635700D778F4 /* NSString+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F21C6B7686000F00D7 /* NSString+Utils.m */; }; - 7E60821126D5637900D778F4 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - 7E60821226D5637900D778F4 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - 7E60821326D5638100D778F4 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - 7E60821426D5638200D778F4 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - 7E60821626D5638B00D778F4 /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; - 7E60821726D5638B00D778F4 /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; 7E60821926D5639200D778F4 /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; 7E60821A26D5639200D778F4 /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; 7E60821B26D56A7600D778F4 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 659E59751BC6D82700FA2384 /* Localizable.strings */; }; @@ -914,26 +1077,10 @@ 7EBDD98026D6A1D0009531FA /* SafariWebExtensionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBDD97C26D6A1D0009531FA /* SafariWebExtensionHandler.swift */; }; 7EBDD98226D6A1F2009531FA /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBDD98126D6A1F1009531FA /* Message.swift */; }; 7EBDD98326D6A1F2009531FA /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBDD98126D6A1F1009531FA /* Message.swift */; }; - 7EBDD98526D6A26B009531FA /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; - 7EBDD98626D6A26C009531FA /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; 7EBDD98726D6A2E2009531FA /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; 7EBDD98826D6A2E2009531FA /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; - 7EBDD98926D6A2E9009531FA /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; - 7EBDD98A26D6A2EA009531FA /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; - 7EBDD98B26D6A2FA009531FA /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; - 7EBDD98C26D6A2FA009531FA /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; 7EBDD98D26D6A318009531FA /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; 7EBDD98E26D6A318009531FA /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; - 7EBDD98F26D6A32F009531FA /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; - 7EBDD99026D6A32F009531FA /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; - 7EBDD99126D6A344009531FA /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - 7EBDD99226D6A345009531FA /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - 7EBDD99326D6A351009531FA /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; - 7EBDD99426D6A352009531FA /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; - 7EBDD99526D6A36C009531FA /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; - 7EBDD99626D6A36C009531FA /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; - 7EBDD99726D6A37D009531FA /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - 7EBDD99826D6A37E009531FA /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; 7EBDFE8A26CF92EB00CCE8CC /* FilterDetailsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBDFE8926CF92EB00CCE8CC /* FilterDetailsViewModel.swift */; }; 7EBDFE8B26CF92EB00CCE8CC /* FilterDetailsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBDFE8926CF92EB00CCE8CC /* FilterDetailsViewModel.swift */; }; 7EBDFE8D26CFA44300CCE8CC /* SwitchTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBDFE8C26CFA44300CCE8CC /* SwitchTableViewCell.swift */; }; @@ -1043,7 +1190,6 @@ B22FCD93270B7DBF00B1C935 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 65E5A0991B8632F600319AA3 /* libz.tbd */; }; B22FCD9E270B7DFA00B1C935 /* TunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = D08D44D226E1F6730023FC20 /* TunnelProvider.swift */; }; B22FCDA1270B7F2200B1C935 /* SharedResources+DebugLogs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EF5C50E26C261AF001851D6 /* SharedResources+DebugLogs.swift */; }; - B22FCDA2270B7FA200B1C935 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; B22FCDA3270B7FD000B1C935 /* Constants+Sentry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E2D93FB26F4891D00534DC5 /* Constants+Sentry.swift */; }; B22FCDA4270B814A00B1C935 /* SharedStorageUrls.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ED0B1A126C4334D00B0CE7B /* SharedStorageUrls.swift */; }; B22FCDA5270B816100B1C935 /* SharedResources+applicationResources.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0BA7BBC2631A9160097029B /* SharedResources+applicationResources.swift */; }; @@ -1051,15 +1197,8 @@ B22FCDA7270B819D00B1C935 /* Constants+LocalDnsAddresses.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E2D93F826F4879700534DC5 /* Constants+LocalDnsAddresses.swift */; }; B22FCDA8270B81C100B1C935 /* SharedResources.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EF5C51026C261AF001851D6 /* SharedResources.swift */; }; B22FCDAC270B8AC800B1C935 /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; - B22FCDAD270B8C1300B1C935 /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; - B22FCDAE270B8C5A00B1C935 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; B22FCDAF270B8C7400B1C935 /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; - B22FCDB0270B8CA500B1C935 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; - B22FCDB3270B8D7900B1C935 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; B22FCDB4270B8D8B00B1C935 /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; - B22FCDB5270B8D9700B1C935 /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; - B22FCDB6270B8DAC00B1C935 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - B22FCDB7270B8DD300B1C935 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; B263373B271E420D00046AA1 /* DnsAdGuardSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B29DD474270CB04B0072B42F /* DnsAdGuardSDK.framework */; }; B2673DC227173DFD00E04747 /* SDKMigrationServiceHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2673DB527173DFD00E04747 /* SDKMigrationServiceHelper.swift */; }; B2673DC327173DFD00E04747 /* SDKMigrationServiceHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2673DB527173DFD00E04747 /* SDKMigrationServiceHelper.swift */; }; @@ -1090,7 +1229,6 @@ B2673DE82717418600E04747 /* DnsLogRecordHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2673DE72717418600E04747 /* DnsLogRecordHelper.swift */; }; B2673DE92717418600E04747 /* DnsLogRecordHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2673DE72717418600E04747 /* DnsLogRecordHelper.swift */; }; B2673DEA2717505400E04747 /* TodayViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E536C69238D2AC400A83A79 /* TodayViewController.swift */; }; - B2673DEB2717505800E04747 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; B2673DED2717506300E04747 /* ServiceInitializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D7367826EA1895003EE3EC /* ServiceInitializer.swift */; }; B2673DEE2717506900E04747 /* LowLevelDnsConfiguration+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D07373A126EB5F0A007366F8 /* LowLevelDnsConfiguration+Utils.swift */; }; B2673DEF2717506D00E04747 /* SharedStorageUrls.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ED0B1A126C4334D00B0CE7B /* SharedStorageUrls.swift */; }; @@ -1100,13 +1238,9 @@ B2673DF3271750B300E04747 /* ThemeMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE8AC1526C595350070D477 /* ThemeMode.swift */; }; B2673DF4271750B800E04747 /* VpnManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D090FC942407E53700A0C026 /* VpnManager.swift */; }; B2673DF5271750BC00E04747 /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; - B2673DF6271750C100E04747 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; - B2673DF8271750C700E04747 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; B2673DF9271750CB00E04747 /* NSString+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F21C6B7686000F00D7 /* NSString+Utils.m */; }; - B2673DFA271750D200E04747 /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; B2673DFB271750D500E04747 /* NotificationCenter+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EAD352626C2C657001AFB3A /* NotificationCenter+Utils.swift */; }; B2673DFC271750DC00E04747 /* SharedResources.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EF5C51026C261AF001851D6 /* SharedResources.swift */; }; - B2673DFD271750E100E04747 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; B2673DFE271750E400E04747 /* SharedResources+applicationResources.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0BA7BBC2631A9160097029B /* SharedResources+applicationResources.swift */; }; B2673DFF271750E800E04747 /* SafariConfiguration+Initializers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE461C626FE568D00DFBF2A /* SafariConfiguration+Initializers.swift */; }; B2673E00271750EB00E04747 /* UIDevice+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E15DFD626E63A460020247E /* UIDevice+Utils.swift */; }; @@ -1121,11 +1255,8 @@ B2673E092717510E00E04747 /* APCommonSharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = D05CA86C1F3B6455006DFD7F /* APCommonSharedResources.m */; }; B2673E0A2717512300E04747 /* String+NSRange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 244419832614C1BC009555F3 /* String+NSRange.swift */; }; B2673E0B2717512B00E04747 /* ConfigurationServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D03E532C21B6A3B400C62152 /* ConfigurationServiceProtocol.swift */; }; - B2673E0C2717512E00E04747 /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; B2673E0D2717514500E04747 /* String+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0CDAEA42191C9540028001B /* String+Utils.swift */; }; - B2673E0E2717514900E04747 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; B2673E0F2717514D00E04747 /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; - B2673E102717515500E04747 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; B2673E112717515900E04747 /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; B2673E122717515C00E04747 /* UIColor+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E9C0BCC25627E8D00F1999D /* UIColor+Utils.swift */; }; B2673E132717516000E04747 /* PurchaseStatusProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2C19E7E2716DFDE00331109 /* PurchaseStatusProtocol.swift */; }; @@ -1135,7 +1266,6 @@ B2673E172717523E00E04747 /* ThemeMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE8AC1526C595350070D477 /* ThemeMode.swift */; }; B2673E182717524B00E04747 /* URL+CustomSchemeURLParserProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 247521F12594C0D500BE9177 /* URL+CustomSchemeURLParserProtocol.swift */; }; B2673E192717524F00E04747 /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; - B2673E1A2717525300E04747 /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; B2673E1B2717525600E04747 /* PurchaseService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F91179213422E1006DF0D3 /* PurchaseService.swift */; }; B2673E1C2717525A00E04747 /* PurchaseServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2C19E7B2716DE5800331109 /* PurchaseServiceProtocol.swift */; }; B2673E1D2717525E00E04747 /* NSString+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F21C6B7686000F00D7 /* NSString+Utils.m */; }; @@ -1147,14 +1277,12 @@ B2673E23271752A300E04747 /* ACIOUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B21C6B7686000F00D7 /* ACIOUtils.m */; }; B2673E24271752A700E04747 /* UIDevice+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E15DFD626E63A460020247E /* UIDevice+Utils.swift */; }; B2673E25271752AB00E04747 /* Array+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24ED98C5259B78DF00A73B17 /* Array+Utils.swift */; }; - B2673E26271752AF00E04747 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; B2673E27271752B200E04747 /* PurchaseStatusProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2C19E7E2716DFDE00331109 /* PurchaseStatusProtocol.swift */; }; B2673E28271752B600E04747 /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; B2673E29271752B900E04747 /* ActionExtensionWebReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2490F6442700685D00B1514D /* ActionExtensionWebReporter.swift */; }; B2673E2A271752BC00E04747 /* ActionExtensionLoaderViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6EFA2B26F87988002EED38 /* ActionExtensionLoaderViewController.swift */; }; B2673E2B271752BF00E04747 /* RoundRectButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = D077D5F42139774E00D3D5B3 /* RoundRectButton.swift */; }; B2673E2C271752C300E04747 /* NSStringPunycodeAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 658E43971E8911A3008DAA59 /* NSStringPunycodeAdditions.m */; }; - B2673E2D271752C700E04747 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; B2673E2E271752CA00E04747 /* ThemableImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09E9645216CE10F00313AB1 /* ThemableImageView.swift */; }; B2673E2F271752CD00E04747 /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; B2673E30271752D100E04747 /* WebReporterWrapperProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 241FEB0B2701C84F00C1C487 /* WebReporterWrapperProtocol.swift */; }; @@ -1162,28 +1290,21 @@ B2673E322717532100E04747 /* KeychainService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F7F0C72268946700592B1E /* KeychainService.swift */; }; B2673E332717532500E04747 /* FavIconService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6EFA4426F89D1C002EED38 /* FavIconService.swift */; }; B2673E342717532900E04747 /* String+NSRange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 244419832614C1BC009555F3 /* String+NSRange.swift */; }; - B2673E352717532C00E04747 /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; - B2673E362717533400E04747 /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; B2673E372717533800E04747 /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; B2673E382717533C00E04747 /* ParserProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EB2F93F23F2B64400F9A544 /* ParserProtocol.swift */; }; - B2673E392717533F00E04747 /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - B2673E3A2717534300E04747 /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; B2673E3B2717534600E04747 /* UITraitEnvironment+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E86A9B626CBB591000B395F /* UITraitEnvironment+Utils.swift */; }; B2673E3C2717534900E04747 /* PurchaseAssistant.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2C8E9772716E4AD00ACDED8 /* PurchaseAssistant.swift */; }; - B2673E3D2717534B00E04747 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; B2673E3E2717534E00E04747 /* ActionExtensionUserRulesHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E2BA2E826F9D5AD00B44D4A /* ActionExtensionUserRulesHelper.swift */; }; B2673E3F2717535100E04747 /* ACIOStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B01C6B7686000F00D7 /* ACIOStream.m */; }; B2673E402717535600E04747 /* ABECRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D0CAFC268B058100AD427E /* ABECRequest.m */; }; B2673E412717535800E04747 /* SharedResources.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EF5C51026C261AF001851D6 /* SharedResources.swift */; }; B2673E422717535D00E04747 /* PreloadedFilesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ED0B19826C4220900B0CE7B /* PreloadedFilesManager.swift */; }; - B2673E432717536100E04747 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; B2673E442717536A00E04747 /* WebReporterSafariFiltersWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24C31ECA26FF749300673309 /* WebReporterSafariFiltersWrapper.swift */; }; B2673E452717536E00E04747 /* SharedResources+Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E18443426F773470085CDE3 /* SharedResources+Theme.swift */; }; B2673E462717537200E04747 /* SharedResources+applicationResources.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0BA7BBC2631A9160097029B /* SharedResources+applicationResources.swift */; }; B2673E472717537600E04747 /* DispatchQueue+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E92754A26C6C02F007B2C80 /* DispatchQueue+Utils.swift */; }; B2673E482717538A00E04747 /* UIColorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F9116D212FFCD6006DF0D3 /* UIColorUtils.swift */; }; B2673E492717538E00E04747 /* ACNHttpUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01FE1C6B7686000F00D7 /* ACNHttpUtils.m */; }; - B2673E4A2717539100E04747 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; B2673E4B2717539600E04747 /* ACLExecuteBlockDelayed.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B81C6B7686000F00D7 /* ACLExecuteBlockDelayed.m */; }; B2673E4C2717539B00E04747 /* ServicesInitializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6EFA2E26F887B9002EED38 /* ServicesInitializer.swift */; }; B2673E4D2717539F00E04747 /* WebReporterProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2490F64927006CF300B1514D /* WebReporterProtocol.swift */; }; @@ -1201,38 +1322,26 @@ B2673E592717540A00E04747 /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; B2673E5A2717540D00E04747 /* ThemableButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EB55269242243C1000498CC /* ThemableButton.swift */; }; B2673E5B2717541000E04747 /* LoginResponseParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0EFBF5D22BB6BAC00D2D391 /* LoginResponseParser.swift */; }; - B2673E5C2717541400E04747 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; B2673E5D2717541700E04747 /* Bundle+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09E2A97254AC0D5002D6BC0 /* Bundle+Utils.swift */; }; B2673E5E2717541A00E04747 /* SharedStorageUrls.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ED0B1A126C4334D00B0CE7B /* SharedStorageUrls.swift */; }; B2673E5F2717541E00E04747 /* URL+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E40799A231E7E4E007EFB26 /* URL+Utils.swift */; }; B2673E602717542100E04747 /* String+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0CDAEA42191C9540028001B /* String+Utils.swift */; }; B2673E612717542400E04747 /* UIViewController+Alert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E2BA2E326F9D3D600B44D4A /* UIViewController+Alert.swift */; }; B2673E622717542700E04747 /* ConfigurationServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D03E532C21B6A3B400C62152 /* ConfigurationServiceProtocol.swift */; }; - B2673E632717542A00E04747 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; B2673E642717542F00E04747 /* ThemeService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09E9643216CB14A00313AB1 /* ThemeService.swift */; }; B2673E652717543200E04747 /* ThemableLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09E9647216CE5E400313AB1 /* ThemableLabel.swift */; }; B2673E662717543600E04747 /* ACSSystemUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02091C6B7686000F00D7 /* ACSSystemUtils.m */; }; B2673E672717543900E04747 /* ADLocations.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8C1BB9824C00F53F3B /* ADLocations.m */; }; B2673E682717543C00E04747 /* NSURL+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F61C6B7686000F00D7 /* NSURL+Utils.m */; }; - B2673E692717543F00E04747 /* ACLLogFileManagerDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0977A6B221D8B3E00E10AC8 /* ACLLogFileManagerDefault.swift */; }; B2673E6A2717544100E04747 /* NotificationCenter+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EAD352626C2C657001AFB3A /* NotificationCenter+Utils.swift */; }; - B2673E6B2717544400E04747 /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; B2673E6C2717545B00E04747 /* AdGuardDependencies.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2C8E9982716FDB300ACDED8 /* AdGuardDependencies.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - B2673E6D2717547D00E04747 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; B2673E6E2717548100E04747 /* TunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = D08D44D226E1F6730023FC20 /* TunnelProvider.swift */; }; - B2673E6F2717548400E04747 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; - B2673E702717548800E04747 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - B2673E712717548B00E04747 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; B2673E722717548F00E04747 /* SharedResources.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EF5C51026C261AF001851D6 /* SharedResources.swift */; }; - B2673E732717549300E04747 /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; B2673E742717549600E04747 /* SharedResources+DebugLogs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EF5C50E26C261AF001851D6 /* SharedResources+DebugLogs.swift */; }; B2673E752717549900E04747 /* SharedResources+applicationResources.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0BA7BBC2631A9160097029B /* SharedResources+applicationResources.swift */; }; B2673E762717549C00E04747 /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; B2673E772717549F00E04747 /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; - B2673E78271754A300E04747 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; - B2673E79271754A600E04747 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; B2673E7A271754A900E04747 /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; - B2673E7B271754AC00E04747 /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; B2673E7C271754AE00E04747 /* Constants+Sentry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E2D93FB26F4891D00534DC5 /* Constants+Sentry.swift */; }; B2673E7D271754B100E04747 /* Constants+LocalDnsAddresses.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E2D93F826F4879700534DC5 /* Constants+LocalDnsAddresses.swift */; }; B2673E7E271754B400E04747 /* SharedStorageUrls.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ED0B1A126C4334D00B0CE7B /* SharedStorageUrls.swift */; }; @@ -1335,7 +1444,6 @@ B2C19E6D2716BE7100331109 /* Bundle+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09E2A97254AC0D5002D6BC0 /* Bundle+Utils.swift */; }; B2C19E6E2716BE9000331109 /* SharedResources+DebugLogs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EF5C50E26C261AF001851D6 /* SharedResources+DebugLogs.swift */; }; B2C19E6F2716BEA800331109 /* Date+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D02B550022EED4AE0039BC48 /* Date+Utils.swift */; }; - B2C19E702716BEC400331109 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; B2C19E712716BED500331109 /* String+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0CDAEA42191C9540028001B /* String+Utils.swift */; }; B2C19E722716BEE700331109 /* DispatchQueue+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E92754A26C6C02F007B2C80 /* DispatchQueue+Utils.swift */; }; B2C19E732716BEF900331109 /* String+NSRange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 244419832614C1BC009555F3 /* String+NSRange.swift */; }; @@ -1355,16 +1463,9 @@ B2C8E97B2716E63300ACDED8 /* UIDevice+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E15DFD626E63A460020247E /* UIDevice+Utils.swift */; }; B2C8E97C2716E80D00ACDED8 /* DnsConfiguration+Initializers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE461C926FE569900DFBF2A /* DnsConfiguration+Initializers.swift */; }; B2C8E97D2716E84A00ACDED8 /* LowLevelDnsConfiguration+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D07373A126EB5F0A007366F8 /* LowLevelDnsConfiguration+Utils.swift */; }; - B2C8E97E2716E8E700ACDED8 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; - B2C8E97F2716E90100ACDED8 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; B2C8E9802716E91200ACDED8 /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; B2C8E9812716E91A00ACDED8 /* ADProductInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8F1BB9824C00F53F3B /* ADProductInfo.m */; }; - B2C8E9822716E92700ACDED8 /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; B2C8E9832716E93A00ACDED8 /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; - B2C8E9842716E96600ACDED8 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - B2C8E9852716E97F00ACDED8 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - B2C8E9862716E98700ACDED8 /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; - B2C8E9872716E99700ACDED8 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; B2C8E9882716E9AA00ACDED8 /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; B2C8E9892716E9FF00ACDED8 /* NSString+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F21C6B7686000F00D7 /* NSString+Utils.m */; }; B2C8E98A2716EA0800ACDED8 /* APCommonSharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = D05CA86C1F3B6455006DFD7F /* APCommonSharedResources.m */; }; @@ -1448,7 +1549,6 @@ D024968B256F9DFC000EED34 /* ImportSettings.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D024968D256F9DFC000EED34 /* ImportSettings.storyboard */; }; D024973E25714928000EED34 /* Setapp in Frameworks */ = {isa = PBXBuildFile; productRef = D024973D25714928000EED34 /* Setapp */; }; D0288F2D2305AEF900A4EBEF /* UIColorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F9116D212FFCD6006DF0D3 /* UIColorUtils.swift */; }; - D0288F2E2306974F00A4EBEF /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; D0288F30230697BA00A4EBEF /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A020F1C6B7686000F00D7 /* Reachability.m */; }; D0288F31230697C800A4EBEF /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; D0288F362306983800A4EBEF /* ACIOUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B21C6B7686000F00D7 /* ACIOUtils.m */; }; @@ -1456,12 +1556,6 @@ D0288F382306985000A4EBEF /* ACNCidrRange.m in Sources */ = {isa = PBXBuildFile; fileRef = D0116CED20627E58009598B1 /* ACNCidrRange.m */; }; D0288F39230698D300A4EBEF /* ACNHttpUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01FE1C6B7686000F00D7 /* ACNHttpUtils.m */; }; D0288F3A230698DB00A4EBEF /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; - D0288F3D2306995800A4EBEF /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; - D0288F3E2306996E00A4EBEF /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - D0288F3F2306997D00A4EBEF /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; - D0288F402306998600A4EBEF /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - D0288F41230699A900A4EBEF /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; - D0288F42230699CF00A4EBEF /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; D0288F4323069A9E00A4EBEF /* NSStringPunycodeAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 658E43971E8911A3008DAA59 /* NSStringPunycodeAdditions.m */; }; D0288F4423069ACB00A4EBEF /* NSDate+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EC1C6B7686000F00D7 /* NSDate+Utils.m */; }; D0288F4C23069D7200A4EBEF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0288F4B23069D7200A4EBEF /* AppDelegate.swift */; }; @@ -1472,89 +1566,7 @@ D02C080E21BEAD0F00796714 /* ConfigurationServiceMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = D02C080D21BEAD0F00796714 /* ConfigurationServiceMock.swift */; }; D0319F9E21947633002C17D9 /* RuleDetailsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0319F9D21947633002C17D9 /* RuleDetailsController.swift */; }; D0319FA021947808002C17D9 /* BottomAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0319F9F21947808002C17D9 /* BottomAlertController.swift */; }; - D031A0C9219EFC99002C17D9 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - D031A0CA219EFC99002C17D9 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - D031A0CB219EFC99002C17D9 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - D031A0CC219EFC99002C17D9 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - D031A0CD219EFC99002C17D9 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - D031A0CE219EFC99002C17D9 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - D031A0CF219EFC99002C17D9 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - D031A0D0219EFC99002C17D9 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - D031A0D7219EFC99002C17D9 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - D031A0D8219EFC99002C17D9 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - D031A0D9219EFC99002C17D9 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - D031A0DA219EFC99002C17D9 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - D031A0DB219EFC99002C17D9 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - D031A0DC219EFC99002C17D9 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - D031A0DD219EFC99002C17D9 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - D031A0DE219EFC99002C17D9 /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; - D031A101219EFC99002C17D9 /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - D031A102219EFC99002C17D9 /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - D031A103219EFC99002C17D9 /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - D031A104219EFC99002C17D9 /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - D031A105219EFC99002C17D9 /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - D031A106219EFC99002C17D9 /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - D031A107219EFC99002C17D9 /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - D031A108219EFC99002C17D9 /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - D031A10F219EFC99002C17D9 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; - D031A11D219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - D031A11E219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - D031A11F219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - D031A120219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - D031A121219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - D031A122219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - D031A123219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - D031A124219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - D031A12B219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; - D031A12C219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; - D031A12D219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; - D031A12E219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; - D031A12F219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; - D031A130219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; - D031A131219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; - D031A132219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; - D031A139219EFC99002C17D9 /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - D031A13A219EFC99002C17D9 /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - D031A13B219EFC99002C17D9 /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - D031A13C219EFC99002C17D9 /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - D031A13D219EFC99002C17D9 /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - D031A13E219EFC99002C17D9 /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - D031A13F219EFC99002C17D9 /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - D031A140219EFC99002C17D9 /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - D031A147219EFC99002C17D9 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; - D031A148219EFC99002C17D9 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; - D031A149219EFC99002C17D9 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; - D031A14A219EFC99002C17D9 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; - D031A14B219EFC99002C17D9 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; - D031A14C219EFC99002C17D9 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; - D031A14D219EFC99002C17D9 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; - D031A14E219EFC99002C17D9 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; - D031A155219EFC99002C17D9 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; - D031A156219EFC99002C17D9 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; - D031A157219EFC99002C17D9 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; - D031A158219EFC99002C17D9 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; - D031A159219EFC99002C17D9 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; - D031A15A219EFC99002C17D9 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; - D031A15B219EFC99002C17D9 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; - D031A15C219EFC99002C17D9 /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; - D031A163219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; - D031A164219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; - D031A165219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; - D031A166219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; - D031A167219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; - D031A168219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; - D031A169219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; - D031A16A219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; - D031A171219EFC99002C17D9 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; - D031A172219EFC99002C17D9 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; - D031A173219EFC99002C17D9 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; - D031A174219EFC99002C17D9 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; - D031A175219EFC99002C17D9 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; - D031A176219EFC99002C17D9 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; - D031A177219EFC99002C17D9 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; - D031A178219EFC99002C17D9 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; D034DDAD22CA23030007641A /* UIViewController+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D034DDAC22CA23030007641A /* UIViewController+Utils.swift */; }; - D03E532A21B41FF000C62152 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; D03E532B21B6A16C00C62152 /* ThemeService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09E9643216CB14A00313AB1 /* ThemeService.swift */; }; D03E532D21B6A3B400C62152 /* ConfigurationServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D03E532C21B6A3B400C62152 /* ConfigurationServiceProtocol.swift */; }; D03E532E21B6A42D00C62152 /* ConfigurationServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D03E532C21B6A3B400C62152 /* ConfigurationServiceProtocol.swift */; }; @@ -1607,7 +1619,6 @@ D067D8E521428AA900ECDE6D /* ACSSystemUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02091C6B7686000F00D7 /* ACSSystemUtils.m */; }; D067D8E721428AA900ECDE6D /* NSString+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F21C6B7686000F00D7 /* NSString+Utils.m */; }; D067D8E821428AA900ECDE6D /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; - D067D8E921428AA900ECDE6D /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; D067D8EA21428AA900ECDE6D /* ACLExecuteBlockDelayed.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B81C6B7686000F00D7 /* ACLExecuteBlockDelayed.m */; }; D067D8EB21428AA900ECDE6D /* NSException+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EE1C6B7686000F00D7 /* NSException+Utils.m */; }; D067D8EC21428AA900ECDE6D /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; @@ -1618,7 +1629,6 @@ D067D8F521428AA900ECDE6D /* APCommonSharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = D05CA86C1F3B6455006DFD7F /* APCommonSharedResources.m */; }; D067D8F621428AA900ECDE6D /* ADLocations.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8C1BB9824C00F53F3B /* ADLocations.m */; }; D067D8F721428AA900ECDE6D /* NSDate+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EC1C6B7686000F00D7 /* NSDate+Utils.m */; }; - D067D8F821428AA900ECDE6D /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; D067D8FB21428AA900ECDE6D /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; D067D8FC21428AA900ECDE6D /* ACNHttpUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01FE1C6B7686000F00D7 /* ACNHttpUtils.m */; }; D067D8FD21428AA900ECDE6D /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; @@ -1628,7 +1638,6 @@ D067D91421428B4600ECDE6D /* ADProductInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8F1BB9824C00F53F3B /* ADProductInfo.m */; }; D067D91621428B4600ECDE6D /* ACSSystemUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02091C6B7686000F00D7 /* ACSSystemUtils.m */; }; D067D91921428B4600ECDE6D /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; - D067D91A21428B4600ECDE6D /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; D067D91B21428B4600ECDE6D /* ACLExecuteBlockDelayed.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B81C6B7686000F00D7 /* ACLExecuteBlockDelayed.m */; }; D067D91C21428B4600ECDE6D /* NSException+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EE1C6B7686000F00D7 /* NSException+Utils.m */; }; D067D91D21428B4600ECDE6D /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; @@ -1639,7 +1648,6 @@ D067D92621428B4600ECDE6D /* APCommonSharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = D05CA86C1F3B6455006DFD7F /* APCommonSharedResources.m */; }; D067D92721428B4600ECDE6D /* ADLocations.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8C1BB9824C00F53F3B /* ADLocations.m */; }; D067D92821428B4600ECDE6D /* NSDate+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EC1C6B7686000F00D7 /* NSDate+Utils.m */; }; - D067D92921428B4600ECDE6D /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; D067D92C21428B4600ECDE6D /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; D067D92D21428B4600ECDE6D /* ACNHttpUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01FE1C6B7686000F00D7 /* ACNHttpUtils.m */; }; D067D92E21428B4600ECDE6D /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; @@ -1649,7 +1657,6 @@ D067D94521428B9100ECDE6D /* ADProductInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8F1BB9824C00F53F3B /* ADProductInfo.m */; }; D067D94721428B9100ECDE6D /* ACSSystemUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02091C6B7686000F00D7 /* ACSSystemUtils.m */; }; D067D94A21428B9100ECDE6D /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; - D067D94B21428B9100ECDE6D /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; D067D94C21428B9100ECDE6D /* ACLExecuteBlockDelayed.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B81C6B7686000F00D7 /* ACLExecuteBlockDelayed.m */; }; D067D94D21428B9100ECDE6D /* NSException+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EE1C6B7686000F00D7 /* NSException+Utils.m */; }; D067D94E21428B9100ECDE6D /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; @@ -1660,7 +1667,6 @@ D067D95721428B9100ECDE6D /* APCommonSharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = D05CA86C1F3B6455006DFD7F /* APCommonSharedResources.m */; }; D067D95821428B9100ECDE6D /* ADLocations.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8C1BB9824C00F53F3B /* ADLocations.m */; }; D067D95921428B9100ECDE6D /* NSDate+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EC1C6B7686000F00D7 /* NSDate+Utils.m */; }; - D067D95A21428B9100ECDE6D /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; D067D95D21428B9100ECDE6D /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; D067D95E21428B9100ECDE6D /* ACNHttpUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01FE1C6B7686000F00D7 /* ACNHttpUtils.m */; }; D067D95F21428B9100ECDE6D /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; @@ -1670,7 +1676,6 @@ D067D97621428BB500ECDE6D /* ADProductInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8F1BB9824C00F53F3B /* ADProductInfo.m */; }; D067D97821428BB500ECDE6D /* ACSSystemUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02091C6B7686000F00D7 /* ACSSystemUtils.m */; }; D067D97B21428BB500ECDE6D /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; - D067D97C21428BB500ECDE6D /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; D067D97D21428BB500ECDE6D /* ACLExecuteBlockDelayed.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B81C6B7686000F00D7 /* ACLExecuteBlockDelayed.m */; }; D067D97E21428BB500ECDE6D /* NSException+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EE1C6B7686000F00D7 /* NSException+Utils.m */; }; D067D97F21428BB500ECDE6D /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; @@ -1681,7 +1686,6 @@ D067D98821428BB500ECDE6D /* APCommonSharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = D05CA86C1F3B6455006DFD7F /* APCommonSharedResources.m */; }; D067D98921428BB500ECDE6D /* ADLocations.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8C1BB9824C00F53F3B /* ADLocations.m */; }; D067D98A21428BB500ECDE6D /* NSDate+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EC1C6B7686000F00D7 /* NSDate+Utils.m */; }; - D067D98B21428BB500ECDE6D /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; D067D98E21428BB500ECDE6D /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; D067D98F21428BB500ECDE6D /* ACNHttpUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01FE1C6B7686000F00D7 /* ACNHttpUtils.m */; }; D067D99021428BB500ECDE6D /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; @@ -1873,16 +1877,8 @@ D090FC952407E53700A0C026 /* VpnManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D090FC942407E53700A0C026 /* VpnManager.swift */; }; D091CB292245133E00972AF7 /* ConfigurationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0CB347A212DD1AB003B650E /* ConfigurationService.swift */; }; D0923EA1220A017A009AA5F5 /* Dns64Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0923EA0220A017A009AA5F5 /* Dns64Utils.swift */; }; - D093719321B056B7004A24F1 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; - D093719421B056B8004A24F1 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; - D093719521B056B9004A24F1 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; - D093719621B056B9004A24F1 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; - D093719721B056BA004A24F1 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; - D093719821B056BB004A24F1 /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; D093AA19253447940015351F /* setappPublicKey.pem in Resources */ = {isa = PBXBuildFile; fileRef = D093AA18253447940015351F /* setappPublicKey.pem */; }; D0953E7B231FF83900AE80DB /* Confirm2FaController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0953E7A231FF83900AE80DB /* Confirm2FaController.swift */; }; - D0977A6C221D8B3E00E10AC8 /* ACLLogFileManagerDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0977A6B221D8B3E00E10AC8 /* ACLLogFileManagerDefault.swift */; }; - D0977A6D221D8C9700E10AC8 /* ACLLogFileManagerDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0977A6B221D8B3E00E10AC8 /* ACLLogFileManagerDefault.swift */; }; D098B44924497764003BA4DA /* ActivityTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7EA2B3242424FE8F00FD3304 /* ActivityTableViewCell.xib */; }; D09CB60523ABBA7D008C9FF7 /* OnboardingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09CB60423ABBA7D008C9FF7 /* OnboardingController.swift */; }; D09E271B2541D00B002D6BC0 /* Setapp in Frameworks */ = {isa = PBXBuildFile; productRef = D09E271A2541D00B002D6BC0 /* Setapp */; }; @@ -1918,207 +1914,129 @@ D0AEC26A2409323C003E8FCC /* VpnManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D090FC942407E53700A0C026 /* VpnManager.swift */; }; D0AEC26B24093364003E8FCC /* APCommonSharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = D05CA86C1F3B6455006DFD7F /* APCommonSharedResources.m */; }; D0AEC26F240947F5003E8FCC /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65D8294E1EDDA905008F7F30 /* NetworkExtension.framework */; }; - D0B542992435C6A3002F0AEC /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; D0B5429A2435C6A3002F0AEC /* ACIOUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B21C6B7686000F00D7 /* ACIOUtils.m */; }; D0B5429B2435C6A3002F0AEC /* ADProductInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8F1BB9824C00F53F3B /* ADProductInfo.m */; }; - D0B5429D2435C6A3002F0AEC /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; D0B5429E2435C6A3002F0AEC /* ACSSystemUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02091C6B7686000F00D7 /* ACSSystemUtils.m */; }; - D0B542A02435C6A3002F0AEC /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; D0B542A12435C6A3002F0AEC /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; - D0B542A22435C6A3002F0AEC /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; D0B542A32435C6A3002F0AEC /* ACLExecuteBlockDelayed.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B81C6B7686000F00D7 /* ACLExecuteBlockDelayed.m */; }; D0B542A42435C6A3002F0AEC /* NSException+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EE1C6B7686000F00D7 /* NSException+Utils.m */; }; D0B542A62435C6A3002F0AEC /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; - D0B542A72435C6A3002F0AEC /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; D0B542A82435C6A3002F0AEC /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; D0B542A92435C6A3002F0AEC /* ACFFileUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01A51C6B7686000F00D7 /* ACFFileUtils.m */; }; - D0B542AA2435C6A3002F0AEC /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - D0B542AD2435C6A3002F0AEC /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; D0B542AE2435C6A3002F0AEC /* ACIOStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B01C6B7686000F00D7 /* ACIOStream.m */; }; D0B542AF2435C6A3002F0AEC /* NSURL+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F61C6B7686000F00D7 /* NSURL+Utils.m */; }; D0B542B02435C6A3002F0AEC /* APCommonSharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = D05CA86C1F3B6455006DFD7F /* APCommonSharedResources.m */; }; - D0B542B12435C6A3002F0AEC /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - D0B542B22435C6A3002F0AEC /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; D0B542B32435C6A3002F0AEC /* ADLocations.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8C1BB9824C00F53F3B /* ADLocations.m */; }; D0B542B52435C6A3002F0AEC /* NSDate+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EC1C6B7686000F00D7 /* NSDate+Utils.m */; }; - D0B542B62435C6A3002F0AEC /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; D0B542B72435C6A3002F0AEC /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; D0B542B82435C6A3002F0AEC /* String+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0CDAEA42191C9540028001B /* String+Utils.swift */; }; - D0B542B92435C6A3002F0AEC /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; D0B542BA2435C6A3002F0AEC /* ACNHttpUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01FE1C6B7686000F00D7 /* ACNHttpUtils.m */; }; D0B542BB2435C6A3002F0AEC /* UIColorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F9116D212FFCD6006DF0D3 /* UIColorUtils.swift */; }; - D0B542BC2435C6A3002F0AEC /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - D0B542BD2435C6A3002F0AEC /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; D0B542BE2435C6A3002F0AEC /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; D0B542BF2435C6A3002F0AEC /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A020F1C6B7686000F00D7 /* Reachability.m */; settings = {COMPILER_FLAGS = "-w"; }; }; D0B542C32435C6A3002F0AEC /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 65E5A0991B8632F600319AA3 /* libz.tbd */; }; D0B542D02435C6A7002F0AEC /* ACIOUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B21C6B7686000F00D7 /* ACIOUtils.m */; }; D0B542D12435C6A7002F0AEC /* ADProductInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8F1BB9824C00F53F3B /* ADProductInfo.m */; }; - D0B542D22435C6A7002F0AEC /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; D0B542D52435C6A7002F0AEC /* ACSSystemUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02091C6B7686000F00D7 /* ACSSystemUtils.m */; }; - D0B542D62435C6A7002F0AEC /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; - D0B542D82435C6A7002F0AEC /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; D0B542D92435C6A7002F0AEC /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; - D0B542DA2435C6A7002F0AEC /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; D0B542DB2435C6A7002F0AEC /* ACLExecuteBlockDelayed.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B81C6B7686000F00D7 /* ACLExecuteBlockDelayed.m */; }; D0B542DC2435C6A7002F0AEC /* NSException+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EE1C6B7686000F00D7 /* NSException+Utils.m */; }; D0B542DD2435C6A7002F0AEC /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; D0B542DF2435C6A7002F0AEC /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; - D0B542E02435C6A7002F0AEC /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; D0B542E12435C6A7002F0AEC /* ACFFileUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01A51C6B7686000F00D7 /* ACFFileUtils.m */; }; D0B542E22435C6A7002F0AEC /* ACIOStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B01C6B7686000F00D7 /* ACIOStream.m */; }; - D0B542E32435C6A7002F0AEC /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - D0B542E62435C6A7002F0AEC /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; D0B542E72435C6A7002F0AEC /* NSURL+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F61C6B7686000F00D7 /* NSURL+Utils.m */; }; D0B542E82435C6A7002F0AEC /* APCommonSharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = D05CA86C1F3B6455006DFD7F /* APCommonSharedResources.m */; }; - D0B542EA2435C6A7002F0AEC /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - D0B542EB2435C6A7002F0AEC /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; D0B542EC2435C6A7002F0AEC /* ADLocations.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8C1BB9824C00F53F3B /* ADLocations.m */; }; D0B542EE2435C6A7002F0AEC /* NSDate+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EC1C6B7686000F00D7 /* NSDate+Utils.m */; }; - D0B542EF2435C6A7002F0AEC /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; D0B542F02435C6A7002F0AEC /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; D0B542F12435C6A7002F0AEC /* String+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0CDAEA42191C9540028001B /* String+Utils.swift */; }; - D0B542F22435C6A7002F0AEC /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; D0B542F32435C6A7002F0AEC /* ACNHttpUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01FE1C6B7686000F00D7 /* ACNHttpUtils.m */; }; D0B542F42435C6A7002F0AEC /* UIColorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F9116D212FFCD6006DF0D3 /* UIColorUtils.swift */; }; - D0B542F52435C6A7002F0AEC /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - D0B542F62435C6A7002F0AEC /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; D0B542F72435C6A7002F0AEC /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; D0B542F82435C6A7002F0AEC /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A020F1C6B7686000F00D7 /* Reachability.m */; settings = {COMPILER_FLAGS = "-w"; }; }; D0B542FC2435C6A7002F0AEC /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 65E5A0991B8632F600319AA3 /* libz.tbd */; }; - D0B5430B2435C6AA002F0AEC /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; D0B5430C2435C6AA002F0AEC /* ACIOUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B21C6B7686000F00D7 /* ACIOUtils.m */; }; D0B5430D2435C6AA002F0AEC /* ADProductInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8F1BB9824C00F53F3B /* ADProductInfo.m */; }; - D0B5430F2435C6AA002F0AEC /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; D0B543102435C6AA002F0AEC /* ACSSystemUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02091C6B7686000F00D7 /* ACSSystemUtils.m */; }; - D0B543122435C6AA002F0AEC /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; D0B543132435C6AA002F0AEC /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; - D0B543142435C6AA002F0AEC /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; D0B543152435C6AA002F0AEC /* ACLExecuteBlockDelayed.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B81C6B7686000F00D7 /* ACLExecuteBlockDelayed.m */; }; D0B543162435C6AA002F0AEC /* NSException+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EE1C6B7686000F00D7 /* NSException+Utils.m */; }; D0B543182435C6AA002F0AEC /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; - D0B543192435C6AA002F0AEC /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; D0B5431A2435C6AA002F0AEC /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; D0B5431B2435C6AA002F0AEC /* ACFFileUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01A51C6B7686000F00D7 /* ACFFileUtils.m */; }; - D0B5431C2435C6AA002F0AEC /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - D0B5431F2435C6AA002F0AEC /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; D0B543202435C6AA002F0AEC /* ACIOStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B01C6B7686000F00D7 /* ACIOStream.m */; }; D0B543212435C6AA002F0AEC /* NSURL+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F61C6B7686000F00D7 /* NSURL+Utils.m */; }; D0B543222435C6AA002F0AEC /* APCommonSharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = D05CA86C1F3B6455006DFD7F /* APCommonSharedResources.m */; }; - D0B543232435C6AA002F0AEC /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - D0B543242435C6AA002F0AEC /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; D0B543252435C6AA002F0AEC /* ADLocations.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8C1BB9824C00F53F3B /* ADLocations.m */; }; D0B543272435C6AA002F0AEC /* NSDate+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EC1C6B7686000F00D7 /* NSDate+Utils.m */; }; - D0B543282435C6AA002F0AEC /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; D0B543292435C6AA002F0AEC /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; D0B5432A2435C6AA002F0AEC /* String+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0CDAEA42191C9540028001B /* String+Utils.swift */; }; - D0B5432B2435C6AA002F0AEC /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; D0B5432C2435C6AA002F0AEC /* ACNHttpUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01FE1C6B7686000F00D7 /* ACNHttpUtils.m */; }; D0B5432D2435C6AA002F0AEC /* UIColorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F9116D212FFCD6006DF0D3 /* UIColorUtils.swift */; }; - D0B5432E2435C6AA002F0AEC /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - D0B5432F2435C6AA002F0AEC /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; D0B543302435C6AA002F0AEC /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; D0B543312435C6AA002F0AEC /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A020F1C6B7686000F00D7 /* Reachability.m */; settings = {COMPILER_FLAGS = "-w"; }; }; D0B543352435C6AA002F0AEC /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 65E5A0991B8632F600319AA3 /* libz.tbd */; }; - D0B543442435C6AE002F0AEC /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; D0B543452435C6AE002F0AEC /* ACIOUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B21C6B7686000F00D7 /* ACIOUtils.m */; }; D0B543462435C6AE002F0AEC /* ADProductInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8F1BB9824C00F53F3B /* ADProductInfo.m */; }; - D0B543482435C6AE002F0AEC /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; D0B543492435C6AE002F0AEC /* ACSSystemUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02091C6B7686000F00D7 /* ACSSystemUtils.m */; }; - D0B5434B2435C6AE002F0AEC /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; D0B5434C2435C6AE002F0AEC /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; - D0B5434D2435C6AE002F0AEC /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; D0B5434E2435C6AE002F0AEC /* ACLExecuteBlockDelayed.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B81C6B7686000F00D7 /* ACLExecuteBlockDelayed.m */; }; D0B5434F2435C6AE002F0AEC /* NSException+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EE1C6B7686000F00D7 /* NSException+Utils.m */; }; D0B543512435C6AE002F0AEC /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; - D0B543522435C6AE002F0AEC /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; D0B543532435C6AE002F0AEC /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; D0B543542435C6AE002F0AEC /* ACFFileUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01A51C6B7686000F00D7 /* ACFFileUtils.m */; }; - D0B543552435C6AE002F0AEC /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - D0B543582435C6AE002F0AEC /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; D0B543592435C6AE002F0AEC /* ACIOStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B01C6B7686000F00D7 /* ACIOStream.m */; }; D0B5435A2435C6AE002F0AEC /* NSURL+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F61C6B7686000F00D7 /* NSURL+Utils.m */; }; D0B5435B2435C6AE002F0AEC /* APCommonSharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = D05CA86C1F3B6455006DFD7F /* APCommonSharedResources.m */; }; - D0B5435C2435C6AE002F0AEC /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - D0B5435D2435C6AE002F0AEC /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; D0B5435E2435C6AE002F0AEC /* ADLocations.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8C1BB9824C00F53F3B /* ADLocations.m */; }; D0B543602435C6AE002F0AEC /* NSDate+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EC1C6B7686000F00D7 /* NSDate+Utils.m */; }; - D0B543612435C6AE002F0AEC /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; D0B543622435C6AE002F0AEC /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; D0B543632435C6AE002F0AEC /* String+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0CDAEA42191C9540028001B /* String+Utils.swift */; }; - D0B543642435C6AE002F0AEC /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; D0B543652435C6AE002F0AEC /* ACNHttpUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01FE1C6B7686000F00D7 /* ACNHttpUtils.m */; }; D0B543662435C6AE002F0AEC /* UIColorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F9116D212FFCD6006DF0D3 /* UIColorUtils.swift */; }; - D0B543672435C6AE002F0AEC /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - D0B543682435C6AE002F0AEC /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; D0B543692435C6AE002F0AEC /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; D0B5436A2435C6AE002F0AEC /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A020F1C6B7686000F00D7 /* Reachability.m */; settings = {COMPILER_FLAGS = "-w"; }; }; D0B5436E2435C6AE002F0AEC /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 65E5A0991B8632F600319AA3 /* libz.tbd */; }; - D0B5437D2435C6B1002F0AEC /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; D0B5437E2435C6B1002F0AEC /* ACIOUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B21C6B7686000F00D7 /* ACIOUtils.m */; }; D0B5437F2435C6B1002F0AEC /* ADProductInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8F1BB9824C00F53F3B /* ADProductInfo.m */; }; - D0B543812435C6B1002F0AEC /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; D0B543822435C6B1002F0AEC /* ACSSystemUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02091C6B7686000F00D7 /* ACSSystemUtils.m */; }; - D0B543842435C6B1002F0AEC /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; D0B543852435C6B1002F0AEC /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; - D0B543862435C6B1002F0AEC /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; D0B543872435C6B1002F0AEC /* ACLExecuteBlockDelayed.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B81C6B7686000F00D7 /* ACLExecuteBlockDelayed.m */; }; D0B543882435C6B1002F0AEC /* NSException+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EE1C6B7686000F00D7 /* NSException+Utils.m */; }; D0B5438A2435C6B1002F0AEC /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; - D0B5438B2435C6B1002F0AEC /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; D0B5438C2435C6B1002F0AEC /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; D0B5438D2435C6B1002F0AEC /* ACFFileUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01A51C6B7686000F00D7 /* ACFFileUtils.m */; }; - D0B5438E2435C6B1002F0AEC /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - D0B543912435C6B1002F0AEC /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; D0B543922435C6B1002F0AEC /* ACIOStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B01C6B7686000F00D7 /* ACIOStream.m */; }; D0B543932435C6B1002F0AEC /* NSURL+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F61C6B7686000F00D7 /* NSURL+Utils.m */; }; D0B543942435C6B1002F0AEC /* APCommonSharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = D05CA86C1F3B6455006DFD7F /* APCommonSharedResources.m */; }; - D0B543952435C6B1002F0AEC /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - D0B543962435C6B1002F0AEC /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; D0B543972435C6B1002F0AEC /* ADLocations.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8C1BB9824C00F53F3B /* ADLocations.m */; }; D0B543992435C6B1002F0AEC /* NSDate+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EC1C6B7686000F00D7 /* NSDate+Utils.m */; }; - D0B5439A2435C6B1002F0AEC /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; D0B5439B2435C6B1002F0AEC /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; D0B5439C2435C6B1002F0AEC /* String+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0CDAEA42191C9540028001B /* String+Utils.swift */; }; - D0B5439D2435C6B1002F0AEC /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; D0B5439E2435C6B1002F0AEC /* ACNHttpUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01FE1C6B7686000F00D7 /* ACNHttpUtils.m */; }; D0B5439F2435C6B1002F0AEC /* UIColorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F9116D212FFCD6006DF0D3 /* UIColorUtils.swift */; }; - D0B543A02435C6B1002F0AEC /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - D0B543A12435C6B1002F0AEC /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; D0B543A22435C6B1002F0AEC /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; D0B543A32435C6B1002F0AEC /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A020F1C6B7686000F00D7 /* Reachability.m */; settings = {COMPILER_FLAGS = "-w"; }; }; D0B543A72435C6B1002F0AEC /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 65E5A0991B8632F600319AA3 /* libz.tbd */; }; - D0B543B62435C6B5002F0AEC /* DDDispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */; }; D0B543B72435C6B5002F0AEC /* ACIOUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B21C6B7686000F00D7 /* ACIOUtils.m */; }; D0B543B82435C6B5002F0AEC /* ADProductInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8F1BB9824C00F53F3B /* ADProductInfo.m */; }; - D0B543BA2435C6B5002F0AEC /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */; }; D0B543BB2435C6B5002F0AEC /* ACSSystemUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02091C6B7686000F00D7 /* ACSSystemUtils.m */; }; - D0B543BD2435C6B5002F0AEC /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C6219EFC99002C17D9 /* DDFileLogger.m */; }; D0B543BE2435C6B5002F0AEC /* ACLWildcard.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */; }; - D0B543BF2435C6B5002F0AEC /* ACLFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */; }; D0B543C02435C6B5002F0AEC /* ACLExecuteBlockDelayed.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B81C6B7686000F00D7 /* ACLExecuteBlockDelayed.m */; }; D0B543C12435C6B5002F0AEC /* NSException+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EE1C6B7686000F00D7 /* NSException+Utils.m */; }; D0B543C32435C6B5002F0AEC /* ACNNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A02001C6B7686000F00D7 /* ACNNetworking.m */; }; - D0B543C42435C6B5002F0AEC /* DDLoggerNames.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */; }; D0B543C52435C6B5002F0AEC /* ACLFileLocker.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */; }; D0B543C62435C6B5002F0AEC /* ACFFileUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01A51C6B7686000F00D7 /* ACFFileUtils.m */; }; - D0B543C72435C6B5002F0AEC /* DDContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */; }; - D0B543CA2435C6B5002F0AEC /* DDOSLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0AA219EFC99002C17D9 /* DDOSLogger.m */; }; D0B543CB2435C6B5002F0AEC /* ACIOStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01B01C6B7686000F00D7 /* ACIOStream.m */; }; D0B543CC2435C6B5002F0AEC /* NSURL+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01F61C6B7686000F00D7 /* NSURL+Utils.m */; }; D0B543CD2435C6B5002F0AEC /* APCommonSharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = D05CA86C1F3B6455006DFD7F /* APCommonSharedResources.m */; }; - D0B543CE2435C6B5002F0AEC /* DDMultiFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */; }; - D0B543CF2435C6B5002F0AEC /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0BE219EFC99002C17D9 /* DDLog.m */; }; D0B543D02435C6B5002F0AEC /* ADLocations.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8C1BB9824C00F53F3B /* ADLocations.m */; }; D0B543D22435C6B5002F0AEC /* NSDate+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01EC1C6B7686000F00D7 /* NSDate+Utils.m */; }; - D0B543D32435C6B5002F0AEC /* ACLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01C21C6B7686000F00D7 /* ACLLogger.m */; }; D0B543D42435C6B5002F0AEC /* AESharedResources.m in Sources */ = {isa = PBXBuildFile; fileRef = 65AD3BBA1B7CB15400004A02 /* AESharedResources.m */; }; D0B543D52435C6B5002F0AEC /* String+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0CDAEA42191C9540028001B /* String+Utils.swift */; }; - D0B543D62435C6B5002F0AEC /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; D0B543D72435C6B5002F0AEC /* ACNHttpUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A01FE1C6B7686000F00D7 /* ACNHttpUtils.m */; }; D0B543D82435C6B5002F0AEC /* UIColorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F9116D212FFCD6006DF0D3 /* UIColorUtils.swift */; }; - D0B543D92435C6B5002F0AEC /* CLIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B2219EFC99002C17D9 /* CLIColor.m */; }; - D0B543DA2435C6B5002F0AEC /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */; }; D0B543DB2435C6B5002F0AEC /* ADLocales.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EC9A8A1BB9824C00F53F3B /* ADLocales.m */; }; D0B543DC2435C6B5002F0AEC /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 655A020F1C6B7686000F00D7 /* Reachability.m */; settings = {COMPILER_FLAGS = "-w"; }; }; D0B543E02435C6B5002F0AEC /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 65E5A0991B8632F600319AA3 /* libz.tbd */; }; @@ -2149,7 +2067,6 @@ D0B545402435C7B9002F0AEC /* AdGuardProTodayExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = D0B5442D2435C6B8002F0AEC /* AdGuardProTodayExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; D0B545412435C7B9002F0AEC /* ProActionExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = D0B544BC2435C6BC002F0AEC /* ProActionExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; D0B545422435C7B9002F0AEC /* ProTunnel.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = D0B545262435C6BF002F0AEC /* ProTunnel.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - D0B545652435D137002F0AEC /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */; }; D0B5456F2435D5CD002F0AEC /* DnsRequestLogModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D020B27A21F894F90075BB8D /* DnsRequestLogModel.swift */; }; D0B545712435D5CD002F0AEC /* NetworkSettingsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E5101922355B53700935FE9 /* NetworkSettingsModel.swift */; }; D0B545722435D5D2002F0AEC /* ParserProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EB2F93F23F2B64400F9A544 /* ParserProtocol.swift */; }; @@ -2222,7 +2139,6 @@ D0B545F32435D6C4002F0AEC /* UIColorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F9116D212FFCD6006DF0D3 /* UIColorUtils.swift */; }; D0B545F72435D6C4002F0AEC /* UIView+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E50492F22F07C4E0095181C /* UIView+Utils.swift */; }; D0B545F82435D6CB002F0AEC /* Date+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D02B550022EED4AE0039BC48 /* Date+Utils.swift */; }; - D0B545F92435D6CB002F0AEC /* ACLLogFileManagerDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0977A6B221D8B3E00E10AC8 /* ACLLogFileManagerDefault.swift */; }; D0B545FA2435D6CB002F0AEC /* String+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0CDAEA42191C9540028001B /* String+Utils.swift */; }; D0B545FB2435D6CB002F0AEC /* URL+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E40799A231E7E4E007EFB26 /* URL+Utils.swift */; }; D0B545FD2435D6D2002F0AEC /* Dns64Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0923EA0220A017A009AA5F5 /* Dns64Utils.swift */; }; @@ -2724,6 +2640,17 @@ 24F66A8426033C9D0097B426 /* OpenDnsSettingsControllerWithLaunchScreenParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenDnsSettingsControllerWithLaunchScreenParser.swift; sourceTree = ""; }; 24F66A9926033DA00097B426 /* OpenMainPageControllerControllerWithLaunchScreenParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenMainPageControllerControllerWithLaunchScreenParser.swift; sourceTree = ""; }; 24F67F5726E778DB00ABF2BE /* SafariWebExtensionParametersParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariWebExtensionParametersParser.swift; sourceTree = ""; }; + 336FA5D96286D339178922B3 /* ObjCLogMacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjCLogMacro.h; sourceTree = ""; }; + 3D1EA6D727D90969005E7153 /* AGLoggerExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AGLoggerExtensions.swift; sourceTree = ""; }; + 3D1EA6E227DA00C5005E7153 /* LoggerManagerExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggerManagerExtensions.swift; sourceTree = ""; }; + 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NativeLoggerWrapperOsLogImpl.swift; sourceTree = ""; }; + 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NativeLoggerWrapperSystemLoggerImpl.swift; sourceTree = ""; }; + 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NativeLoggerWrapper.swift; sourceTree = ""; }; + 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsoleAppDestination.swift; sourceTree = ""; }; + 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggerManagerImpl.swift; sourceTree = ""; }; + 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggerManager.swift; sourceTree = ""; }; + 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogLevel.swift; sourceTree = ""; }; + 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogLevelExtensions.swift; sourceTree = ""; }; 4020A90022C3C863009C188F /* MainNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainNavigationController.swift; sourceTree = ""; }; 4982C0BF26D78F2900CACBBE /* unused.ts */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = unused.ts; sourceTree = ""; }; 4982C0C026D78F2900CACBBE /* helpers.ts */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = helpers.ts; sourceTree = ""; }; @@ -2913,10 +2840,6 @@ 655A01B81C6B7686000F00D7 /* ACLExecuteBlockDelayed.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ACLExecuteBlockDelayed.m; sourceTree = ""; }; 655A01B91C6B7686000F00D7 /* ACLFileLocker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACLFileLocker.h; sourceTree = ""; }; 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACLFileLocker.m; sourceTree = ""; }; - 655A01BB1C6B7686000F00D7 /* ACLFileLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACLFileLogger.h; sourceTree = ""; }; - 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACLFileLogger.m; sourceTree = ""; }; - 655A01C11C6B7686000F00D7 /* ACLLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACLLogger.h; sourceTree = ""; }; - 655A01C21C6B7686000F00D7 /* ACLLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACLLogger.m; sourceTree = ""; }; 655A01CB1C6B7686000F00D7 /* ACLWildcard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACLWildcard.h; sourceTree = ""; }; 655A01CC1C6B7686000F00D7 /* ACLWildcard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACLWildcard.m; sourceTree = ""; }; 655A01EB1C6B7686000F00D7 /* NSDate+Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+Utils.h"; sourceTree = ""; }; @@ -3659,38 +3582,6 @@ D02C080D21BEAD0F00796714 /* ConfigurationServiceMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigurationServiceMock.swift; sourceTree = ""; }; D0319F9D21947633002C17D9 /* RuleDetailsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuleDetailsController.swift; sourceTree = ""; }; D0319F9F21947808002C17D9 /* BottomAlertController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomAlertController.swift; sourceTree = ""; }; - D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDTTYLogger.m; sourceTree = ""; }; - D031A0A8219EFC99002C17D9 /* DDLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDLog.h; sourceTree = ""; }; - D031A0A9219EFC99002C17D9 /* DDLegacyMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDLegacyMacros.h; sourceTree = ""; }; - D031A0AA219EFC99002C17D9 /* DDOSLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDOSLogger.m; sourceTree = ""; }; - D031A0AB219EFC99002C17D9 /* DDAssert.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DDAssert.swift; sourceTree = ""; }; - D031A0AC219EFC99002C17D9 /* DDAbstractDatabaseLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDAbstractDatabaseLogger.h; sourceTree = ""; }; - D031A0AD219EFC99002C17D9 /* DDLoggerNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDLoggerNames.h; sourceTree = ""; }; - D031A0AE219EFC99002C17D9 /* DDLogMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDLogMacros.h; sourceTree = ""; }; - D031A0AF219EFC99002C17D9 /* DDASLLogCapture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDASLLogCapture.h; sourceTree = ""; }; - D031A0B0219EFC99002C17D9 /* DDASLLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDASLLogger.m; sourceTree = ""; }; - D031A0B2219EFC99002C17D9 /* CLIColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CLIColor.m; sourceTree = ""; }; - D031A0B3219EFC99002C17D9 /* CLIColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLIColor.h; sourceTree = ""; }; - D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CocoaLumberjack.swift; sourceTree = ""; }; - D031A0B5219EFC99002C17D9 /* DDFileLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDFileLogger.h; sourceTree = ""; }; - D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDContextFilterLogFormatter.m; sourceTree = ""; }; - D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDDispatchQueueLogFormatter.m; sourceTree = ""; }; - D031A0B9219EFC99002C17D9 /* DDMultiFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDMultiFormatter.h; sourceTree = ""; }; - D031A0BA219EFC99002C17D9 /* DDContextFilterLogFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDContextFilterLogFormatter.h; sourceTree = ""; }; - D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDMultiFormatter.m; sourceTree = ""; }; - D031A0BC219EFC99002C17D9 /* DDDispatchQueueLogFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDDispatchQueueLogFormatter.h; sourceTree = ""; }; - D031A0BD219EFC99002C17D9 /* SwiftLogLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SwiftLogLevel.h; sourceTree = ""; }; - D031A0BE219EFC99002C17D9 /* DDLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDLog.m; sourceTree = ""; }; - D031A0BF219EFC99002C17D9 /* CocoaLumberjack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocoaLumberjack.h; sourceTree = ""; }; - D031A0C0219EFC99002C17D9 /* DDTTYLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDTTYLogger.h; sourceTree = ""; }; - D031A0C1219EFC99002C17D9 /* DDAssertMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDAssertMacros.h; sourceTree = ""; }; - D031A0C2219EFC99002C17D9 /* DDOSLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDOSLogger.h; sourceTree = ""; }; - D031A0C3219EFC99002C17D9 /* DDLog+LOGV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DDLog+LOGV.h"; sourceTree = ""; }; - D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDLoggerNames.m; sourceTree = ""; }; - D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDAbstractDatabaseLogger.m; sourceTree = ""; }; - D031A0C6219EFC99002C17D9 /* DDFileLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDFileLogger.m; sourceTree = ""; }; - D031A0C7219EFC99002C17D9 /* DDASLLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDASLLogger.h; sourceTree = ""; }; - D031A0C8219EFC99002C17D9 /* DDASLLogCapture.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDASLLogCapture.m; sourceTree = ""; }; D034DDAC22CA23030007641A /* UIViewController+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Utils.swift"; sourceTree = ""; }; D03E532C21B6A3B400C62152 /* ConfigurationServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigurationServiceProtocol.swift; sourceTree = ""; }; D044AF742183098A00CD9E06 /* AddRuleController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddRuleController.swift; sourceTree = ""; }; @@ -3759,7 +3650,6 @@ D093AA18253447940015351F /* setappPublicKey.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = setappPublicKey.pem; sourceTree = ""; }; D0953E7A231FF83900AE80DB /* Confirm2FaController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Confirm2FaController.swift; sourceTree = ""; }; D096D9411F28C0D70081004D /* NotificationCenter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NotificationCenter.framework; path = System/Library/Frameworks/NotificationCenter.framework; sourceTree = SDKROOT; }; - D0977A6B221D8B3E00E10AC8 /* ACLLogFileManagerDefault.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ACLLogFileManagerDefault.swift; sourceTree = ""; }; D099DADE228D812E007987F8 /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/DnsSettings.strings; sourceTree = ""; }; D099DADF228D813E007987F8 /* ru */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/DnsSettings.strings; sourceTree = ""; }; D099DAE0228D8141007987F8 /* de */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/DnsSettings.strings; sourceTree = ""; }; @@ -4447,6 +4337,56 @@ path = AppleSearchAd; sourceTree = ""; }; + 3D8EA81227D0CC8400F0172F /* Common */ = { + isa = PBXGroup; + children = ( + 3D8EA81327D0CC9E00F0172F /* Extension */, + 3D8EA81427D0CCAF00F0172F /* Logger */, + ); + path = Common; + sourceTree = ""; + }; + 3D8EA81327D0CC9E00F0172F /* Extension */ = { + isa = PBXGroup; + children = ( + 3D8EA83527D0D0D600F0172F /* LogLevelExtensions.swift */, + 3D1EA6D727D90969005E7153 /* AGLoggerExtensions.swift */, + 3D1EA6E227DA00C5005E7153 /* LoggerManagerExtensions.swift */, + 336FA5D96286D339178922B3 /* ObjCLogMacro.h */, + ); + path = Extension; + sourceTree = ""; + }; + 3D8EA81427D0CCAF00F0172F /* Logger */ = { + isa = PBXGroup; + children = ( + 3D8EA81527D0CCC500F0172F /* Destinations */, + 3D8EA81627D0CCD900F0172F /* NativeLoggerWrapper */, + 3D8EA82C27D0CFC400F0172F /* LoggerManager.swift */, + 3D8EA82327D0CF4200F0172F /* LoggerManagerImpl.swift */, + 3D8EA82F27D0CFD800F0172F /* LogLevel.swift */, + ); + path = Logger; + sourceTree = ""; + }; + 3D8EA81527D0CCC500F0172F /* Destinations */ = { + isa = PBXGroup; + children = ( + 3D8EA82027D0CF0E00F0172F /* ConsoleAppDestination.swift */, + ); + path = Destinations; + sourceTree = ""; + }; + 3D8EA81627D0CCD900F0172F /* NativeLoggerWrapper */ = { + isa = PBXGroup; + children = ( + 3D8EA81D27D0CEBA00F0172F /* NativeLoggerWrapper.swift */, + 3D8EA81727D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift */, + 3D8EA81A27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift */, + ); + path = NativeLoggerWrapper; + sourceTree = ""; + }; 4982C0BC26D78F2900CACBBE /* extension */ = { isa = PBXGroup; children = ( @@ -5386,16 +5326,11 @@ 655A01F61C6B7686000F00D7 /* NSURL+Utils.m */, 658E43961E8911A3008DAA59 /* NSStringPunycodeAdditions.h */, 658E43971E8911A3008DAA59 /* NSStringPunycodeAdditions.m */, - D0977A6B221D8B3E00E10AC8 /* ACLLogFileManagerDefault.swift */, D0CDAEA42191C9540028001B /* String+Utils.swift */, 7E40799A231E7E4E007EFB26 /* URL+Utils.swift */, 244419832614C1BC009555F3 /* String+NSRange.swift */, 655A01B91C6B7686000F00D7 /* ACLFileLocker.h */, 655A01BA1C6B7686000F00D7 /* ACLFileLocker.m */, - 655A01BB1C6B7686000F00D7 /* ACLFileLogger.h */, - 655A01BC1C6B7686000F00D7 /* ACLFileLogger.m */, - 655A01C11C6B7686000F00D7 /* ACLLogger.h */, - 655A01C21C6B7686000F00D7 /* ACLLogger.m */, 655A01CD1C6B7686000F00D7 /* Logger */, 7EAD352626C2C657001AFB3A /* NotificationCenter+Utils.swift */, ); @@ -5405,7 +5340,6 @@ 655A01CD1C6B7686000F00D7 /* Logger */ = { isa = PBXGroup; children = ( - D031A0A6219EFC99002C17D9 /* Lumberjack */, ); path = Logger; sourceTree = ""; @@ -5597,6 +5531,7 @@ 65F398081B7B684700ABCD39 = { isa = PBXGroup; children = ( + 3D8EA81227D0CC8400F0172F /* Common */, D093AA18253447940015351F /* setappPublicKey.pem */, D0B8EB8E2248E54A0066C5AC /* Default-568h@2x.png */, D0CB3476212DCE21003B650E /* Adguard-Bridging-Header.h */, @@ -6474,61 +6409,6 @@ path = TestHostApp; sourceTree = ""; }; - D031A0A6219EFC99002C17D9 /* Lumberjack */ = { - isa = PBXGroup; - children = ( - D031A0A7219EFC99002C17D9 /* DDTTYLogger.m */, - D031A0A8219EFC99002C17D9 /* DDLog.h */, - D031A0A9219EFC99002C17D9 /* DDLegacyMacros.h */, - D031A0AA219EFC99002C17D9 /* DDOSLogger.m */, - D031A0AB219EFC99002C17D9 /* DDAssert.swift */, - D031A0AC219EFC99002C17D9 /* DDAbstractDatabaseLogger.h */, - D031A0AD219EFC99002C17D9 /* DDLoggerNames.h */, - D031A0AE219EFC99002C17D9 /* DDLogMacros.h */, - D031A0AF219EFC99002C17D9 /* DDASLLogCapture.h */, - D031A0B0219EFC99002C17D9 /* DDASLLogger.m */, - D031A0B1219EFC99002C17D9 /* CLI */, - D031A0B4219EFC99002C17D9 /* CocoaLumberjack.swift */, - D031A0B5219EFC99002C17D9 /* DDFileLogger.h */, - D031A0B6219EFC99002C17D9 /* Extensions */, - D031A0BD219EFC99002C17D9 /* SwiftLogLevel.h */, - D031A0BE219EFC99002C17D9 /* DDLog.m */, - D031A0BF219EFC99002C17D9 /* CocoaLumberjack.h */, - D031A0C0219EFC99002C17D9 /* DDTTYLogger.h */, - D031A0C1219EFC99002C17D9 /* DDAssertMacros.h */, - D031A0C2219EFC99002C17D9 /* DDOSLogger.h */, - D031A0C3219EFC99002C17D9 /* DDLog+LOGV.h */, - D031A0C4219EFC99002C17D9 /* DDLoggerNames.m */, - D031A0C5219EFC99002C17D9 /* DDAbstractDatabaseLogger.m */, - D031A0C6219EFC99002C17D9 /* DDFileLogger.m */, - D031A0C7219EFC99002C17D9 /* DDASLLogger.h */, - D031A0C8219EFC99002C17D9 /* DDASLLogCapture.m */, - ); - path = Lumberjack; - sourceTree = ""; - }; - D031A0B1219EFC99002C17D9 /* CLI */ = { - isa = PBXGroup; - children = ( - D031A0B2219EFC99002C17D9 /* CLIColor.m */, - D031A0B3219EFC99002C17D9 /* CLIColor.h */, - ); - path = CLI; - sourceTree = ""; - }; - D031A0B6219EFC99002C17D9 /* Extensions */ = { - isa = PBXGroup; - children = ( - D031A0B7219EFC99002C17D9 /* DDContextFilterLogFormatter.m */, - D031A0B8219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m */, - D031A0B9219EFC99002C17D9 /* DDMultiFormatter.h */, - D031A0BA219EFC99002C17D9 /* DDContextFilterLogFormatter.h */, - D031A0BB219EFC99002C17D9 /* DDMultiFormatter.m */, - D031A0BC219EFC99002C17D9 /* DDDispatchQueueLogFormatter.h */, - ); - path = Extensions; - sourceTree = ""; - }; D067D8CF213ED55100ECDE6D /* ViewModel */ = { isa = PBXGroup; children = ( @@ -8356,7 +8236,6 @@ D0A235512720569400CE1730 /* SharedResources+customBlockingIps.swift in Sources */, 7E8C8C4324E19779000B4B9C /* UIImage+Utils.swift in Sources */, 2490F6572700982900B1514D /* RequestProtocol.swift in Sources */, - 659886591CF74DE9003ECD1C /* ACLLogger.m in Sources */, 7E9E10CB26CC1108007A4B8A /* StateHeaderView.swift in Sources */, 7EE3427324D84A7600A8C0E6 /* AboutViewController.swift in Sources */, 6598865A1CF74DE9003ECD1C /* ACLWildcard.m in Sources */, @@ -8365,13 +8244,11 @@ 2490F6472700685D00B1514D /* ActionExtensionWebReporter.swift in Sources */, 24C31ECF26FF8E5800673309 /* WebReporterDnsProtectionWrapper.swift in Sources */, 6598865B1CF74DE9003ECD1C /* ADLocations.m in Sources */, - D031A15C219EFC99002C17D9 /* DDLoggerNames.m in Sources */, D0B545912435D630002F0AEC /* PurchaseService.swift in Sources */, D0B545FB2435D6CB002F0AEC /* URL+Utils.swift in Sources */, 2413B61A276C984000CAA585 /* UILabel+Utils.swift in Sources */, D0D7E61D244456D2001801A5 /* ActivityViewController.swift in Sources */, D09E2D31255D6AFF002D6BC0 /* SettingsParser.swift in Sources */, - D031A178219EFC99002C17D9 /* DDFileLogger.m in Sources */, 7E7702A326FF5113004A8616 /* TitleHeaderView.swift in Sources */, 7E3FEFA926CCFC8D0080EC03 /* OneSafariGroupFiltersModel.swift in Sources */, D0B545A22435D640002F0AEC /* NetworkSettingsTableController.swift in Sources */, @@ -8413,7 +8290,6 @@ 7E70266726DD412600F8FC25 /* IdentifiableObject.swift in Sources */, D09E2C48255956B4002D6BC0 /* SetappService.swift in Sources */, 7E1A8F5926FDBFAF00BA98D5 /* ContentBlockersTableController.swift in Sources */, - D0B545652435D137002F0AEC /* CocoaLumberjack.swift in Sources */, 24B33D0026C50E0600499281 /* OnboardingAdvancedProtectionView.swift in Sources */, 658E439B1E8911A3008DAA59 /* NSStringPunycodeAdditions.m in Sources */, 7E9AE47F26FB8C4B00F6A953 /* OpenAdvancedProtectionParser.swift in Sources */, @@ -8427,7 +8303,6 @@ 2490F6592700983500B1514D /* SendFeedbackRequest.swift in Sources */, 7E92754326C67CA6007B2C80 /* SafariGroupTableController.swift in Sources */, 7E4EFB0E26DFE6DE00116762 /* UserRulesModelsProvider.swift in Sources */, - D031A124219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */, D0B545E52435D69B002F0AEC /* NetworkSettingsCells.swift in Sources */, D0B545AE2435D646002F0AEC /* NewCustomFilterDetailsController.swift in Sources */, 7EA45506254AB249002B69C6 /* ActivityNativeDnsController.swift in Sources */, @@ -8459,22 +8334,23 @@ D0B545A72435D640002F0AEC /* DnsProvidersController.swift in Sources */, B2673DC727173DFD00E04747 /* SafariProtectionCustomFiltersMigrationHelper.swift in Sources */, 7E0F9BAA272BED3500B1D831 /* StatusBarWindow.swift in Sources */, + 3DB3A31D27DF3CAF00CE8F68 /* AGLoggerExtensions.swift in Sources */, B26B924827197D2400F1D482 /* DnsProtectionCustomProvidersMigrationHelper.swift in Sources */, D0B545DD2435D69B002F0AEC /* LongLabelCell.swift in Sources */, + 3D8EA81C27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, D0B545BA2435D655002F0AEC /* DnsRequestDetailsController.swift in Sources */, 7EA7834D2578E54500CA8889 /* SupportService+Feedback.swift in Sources */, 6598866A1CF74DE9003ECD1C /* ACNNetworking.m in Sources */, - D031A132219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */, 2490F64C27006CF300B1514D /* WebReporterProtocol.swift in Sources */, D0D7E5B924444CCE001801A5 /* DomainParser.swift in Sources */, D0B545722435D5D2002F0AEC /* ParserProtocol.swift in Sources */, D0B545982435D630002F0AEC /* VpnManager.swift in Sources */, + 3D1EA72627DA353B005E7153 /* LogLevelExtensions.swift in Sources */, 6598866E1CF74DE9003ECD1C /* NSURL+Utils.m in Sources */, 24C49DBE26C40AC900790CB3 /* WhatsNewBottomAlertController.swift in Sources */, B2673E8227176D9100E04747 /* PurchaseAssistant.swift in Sources */, D0A235542720651000CE1730 /* LowlevelSettingsMigrationHelper.swift in Sources */, D0B5458E2435D630002F0AEC /* LoginResponseParser.swift in Sources */, - D031A140219EFC99002C17D9 /* DDMultiFormatter.m in Sources */, D0B545CD2435D692002F0AEC /* ImportRulesController.swift in Sources */, 7E18443726F773470085CDE3 /* SharedResources+Theme.swift in Sources */, 2449000A272C3E3900557CEE /* ImportDNSSettingsHelper.swift in Sources */, @@ -8482,6 +8358,7 @@ D0B545FF2435D6D2002F0AEC /* ConfigurationServiceProtocol.swift in Sources */, 24DB3DBF2745443D0038627C /* AdServicesAttributionRecordsRequest.swift in Sources */, 7E473B7825559469006F8345 /* DnsProvidersTableModel.swift in Sources */, + 3DB3A2E527DF386B00CE8F68 /* LoggerManagerExtensions.swift in Sources */, D0B545C82435D669002F0AEC /* EmailSignInController.swift in Sources */, D0B545812435D62A002F0AEC /* CharacterSet+Utils.swift in Sources */, 249EC92226F772F300BEF8F0 /* SelectDnsProtocolController.swift in Sources */, @@ -8491,15 +8368,14 @@ 659886711CF74DE9003ECD1C /* ACIOUtils.m in Sources */, D0B545CC2435D692002F0AEC /* AddRuleController.swift in Sources */, 2483F7E7277B041600BE0A13 /* DnsMigration4_3_1.swift in Sources */, - 659886721CF74DE9003ECD1C /* ACLFileLogger.m in Sources */, 7E2D940026F4893200534DC5 /* Constants+SafariFilters.swift in Sources */, D0B5458B2435D630002F0AEC /* FileShareHelper.swift in Sources */, + 3D8EA81927D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift in Sources */, D0B545A62435D640002F0AEC /* DnsProviderDetailsController.swift in Sources */, D0B545942435D630002F0AEC /* ServiceLocator.swift in Sources */, 7E1A8F6A26FDE37200BA98D5 /* ContentBlockerTableViewCellModel.swift in Sources */, 244419962614C295009555F3 /* String+NSRange.swift in Sources */, D0B5459E2435D63D002F0AEC /* ComplexProtectionSwitch.swift in Sources */, - D031A14E219EFC99002C17D9 /* DDLog.m in Sources */, 7EC67F6D2548301000FEEEE2 /* ChooseDnsImplementationController.swift in Sources */, C7DD46512754E90C006E1E6C /* PremiumFeaturesPagingView.swift in Sources */, D06E6BD525E8F6000069013C /* VpnConfigurationStatus.swift in Sources */, @@ -8529,14 +8405,15 @@ 24A6021526FCB0AE0049A329 /* AdvancedYouTubeBlockingController.swift in Sources */, D0B545BE2435D65C002F0AEC /* MainNavigationController.swift in Sources */, D0B545E02435D69B002F0AEC /* ThemableImageView.swift in Sources */, - D031A108219EFC99002C17D9 /* CLIColor.m in Sources */, 7E1A8F6726FDE1AE00BA98D5 /* ContentBlockerType+Name.swift in Sources */, + 3D8EA81F27D0CEBA00F0172F /* NativeLoggerWrapper.swift in Sources */, 7E92754626C67FCD007B2C80 /* SafariGroupsModel.swift in Sources */, C7DD465D27552EEE006E1E6C /* LicenseProductChoiceCell.swift in Sources */, 24D9226D2604B3DD002F368B /* AppDelegate+UserNotifications.swift in Sources */, 24ED98CA259B78DF00A73B17 /* Array+Utils.swift in Sources */, 7EE8AC1726C595350070D477 /* ThemeMode.swift in Sources */, D0B5459B2435D636002F0AEC /* MainTabBarController.swift in Sources */, + 3DB3A24F27DF2D6C00CE8F68 /* LoggerManagerImpl.swift in Sources */, 247CB5FF2600C5A10047974C /* OpenDnsProvidersControllerWithSDNSParser.swift in Sources */, 2490F655270097FE00B1514D /* RequestSenderProtocol.swift in Sources */, D0D7E5F724444F05001801A5 /* RuleLabel.swift in Sources */, @@ -8550,6 +8427,7 @@ 7EF5C52826C261E2001851D6 /* SharedResources.swift in Sources */, 2490F65D27009DF900B1514D /* HttpRequestServiceProtocol+sendFeedback.swift in Sources */, D0B5459F2435D63D002F0AEC /* GetProDialogView.swift in Sources */, + 3D1EA72327DA3507005E7153 /* LoggerManager.swift in Sources */, 7ED0B1A326C4334D00B0CE7B /* SharedStorageUrls.swift in Sources */, 7E70265D26DD23D700F8FC25 /* UserRulesTableController.swift in Sources */, D0B5458D2435D630002F0AEC /* KeychainService.swift in Sources */, @@ -8567,6 +8445,7 @@ B2673DC527173DFD00E04747 /* SafariProtectionFiltersDatabaseMigrationHelper.swift in Sources */, 7EF5C56926C26BD0001851D6 /* Constants.swift in Sources */, 7E21CBA925F918FA00A5A735 /* NetworkManager.swift in Sources */, + 3DB3A2CF27DF351200CE8F68 /* ConsoleAppDestination.swift in Sources */, 24CE2B85271DA4E700E169E7 /* NetworkSettingsMigration.swift in Sources */, D0B545F72435D6C4002F0AEC /* UIView+Utils.swift in Sources */, D08A21AC270493D200267930 /* DnsLogRecord.swift in Sources */, @@ -8583,6 +8462,7 @@ B2673DDD2717402C00E04747 /* DnsRequestDetailsContainerController.swift in Sources */, D0B545DB2435D69B002F0AEC /* RoundRectButton.swift in Sources */, 244339722580D8AB00AB4F26 /* BlockingModeController.swift in Sources */, + 3D8EA83127D0CFD900F0172F /* LogLevel.swift in Sources */, 7E70266126DD28C600F8FC25 /* SafariUserRulesTableModel.swift in Sources */, 247CB5062600A3220047974C /* URLSchemeParser.swift in Sources */, D0B545FE2435D6D2002F0AEC /* UIApplication+OpenAdguardUrl.swift in Sources */, @@ -8593,7 +8473,6 @@ 247CB5C62600BB1C0047974C /* OpenMainPageControllerParser.swift in Sources */, 659886851CF74DE9003ECD1C /* AEUIPlayerViewController.m in Sources */, 7EA4551A254ABEDE002B69C6 /* AppDelegate+PresentController.swift in Sources */, - D0B545F92435D6CB002F0AEC /* ACLLogFileManagerDefault.swift in Sources */, 7E86A9B826CBB591000B395F /* UITraitEnvironment+Utils.swift in Sources */, 7E1A8F5D26FDD54400BA98D5 /* ContentBlockerTableViewCell.swift in Sources */, D0B545902435D630002F0AEC /* NetworkSettingsService.swift in Sources */, @@ -8617,7 +8496,6 @@ 247432DF261731C00025C7B8 /* UIAlerController+Style.swift in Sources */, 7E0F9BAE272BF49200B1D831 /* StatusBarManager.swift in Sources */, 7E3FEFB526CD3AB60080EC03 /* UITableView+Utils.swift in Sources */, - D031A0D0219EFC99002C17D9 /* DDTTYLogger.m in Sources */, 2490F65E27009E7200B1514D /* RequestFactory.swift in Sources */, B2673DC327173DFD00E04747 /* SDKMigrationServiceHelper.swift in Sources */, 7E0B222925DBB3C900AF88BB /* UpsellViewController.swift in Sources */, @@ -8631,7 +8509,6 @@ 7EDA07C12720490100D2AF86 /* SDKMigrationOldFilesHelper.swift in Sources */, 24490008272C3E2700557CEE /* ImportSettingsService.swift in Sources */, 247CB6132600C8870047974C /* OpenImportSettingsControllerParser.swift in Sources */, - D031A0DE219EFC99002C17D9 /* DDOSLogger.m in Sources */, D0B545C12435D660002F0AEC /* SettingsController.swift in Sources */, 7E3FEFBE26CEB4E90080EC03 /* Bool+Utils.swift in Sources */, B2673DD627173E0F00E04747 /* DomainParserService.swift in Sources */, @@ -8689,7 +8566,6 @@ 659886991CF74DE9003ECD1C /* Reachability.m in Sources */, 7E85A82426F37FBD0059BB33 /* OpenLicenseControllerParser.swift in Sources */, 7EAD352826C2C657001AFB3A /* NotificationCenter+Utils.swift in Sources */, - D031A16A219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */, D0B545E32435D69B002F0AEC /* BottomShadowView.swift in Sources */, 7EAA0D7B26CA8785007208E5 /* SafariFilterCell.swift in Sources */, 7E2D93F626F3A2ED00534DC5 /* DnsFiltersTableModel.swift in Sources */, @@ -8706,10 +8582,10 @@ buildActionMask = 2147483647; files = ( 7EE8AC1926C595F00070D477 /* ThemeMode.swift in Sources */, + 3DB3A30C27DF397300CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, 2408A8A92747ED4500D2D1DE /* HttpRequestService.swift in Sources */, 247521F42594C0D500BE9177 /* URL+CustomSchemeURLParserProtocol.swift in Sources */, 65EC9BCB1BB9824C00F53F3B /* ADLocales.m in Sources */, - D031A131219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */, B29D53B4270D470C0045CB16 /* PurchaseService.swift in Sources */, B2C8E98E2716EC0200ACDED8 /* PurchaseServiceProtocol.swift in Sources */, D0450F82263C2A1500CA2110 /* NSString+Utils.m in Sources */, @@ -8724,7 +8600,6 @@ 655A022A1C6B7686000F00D7 /* ACIOUtils.m in Sources */, 7E15DFD926E63AE30020247E /* UIDevice+Utils.swift in Sources */, 24ED98C8259B78DF00A73B17 /* Array+Utils.swift in Sources */, - D031A14D219EFC99002C17D9 /* DDLog.m in Sources */, B2C8E98F2716EC0700ACDED8 /* PurchaseStatusProtocol.swift in Sources */, 2408A8AA2747ED5200D2D1DE /* RequestSenderProtocol.swift in Sources */, 655A024E1C6B7686000F00D7 /* ACLWildcard.m in Sources */, @@ -8732,37 +8607,35 @@ 7E6EFA2C26F87988002EED38 /* ActionExtensionLoaderViewController.swift in Sources */, 7E16F29B26FA1FDC00383410 /* RoundRectButton.swift in Sources */, D051B05C233101C6008A9A0F /* NSStringPunycodeAdditions.m in Sources */, - D031A169219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */, + 3DB3A30527DF396200CE8F68 /* LoggerManagerImpl.swift in Sources */, 2408A8B02747EDA800D2D1DE /* RequestFactory.swift in Sources */, D03E532F21B6A47E00C62152 /* ThemableImageView.swift in Sources */, 655A02331C6B7686000F00D7 /* ACLFileLocker.m in Sources */, 241FEB0D2701C84F00C1C487 /* WebReporterWrapperProtocol.swift in Sources */, + 3DB3A30627DF396500CE8F68 /* ConsoleAppDestination.swift in Sources */, 7E9C0C36256292E200F1999D /* UIColor+Utils.swift in Sources */, 2408A8B22747EDB900D2D1DE /* AdServicesAttributionRecordsParser.swift in Sources */, + 3DB3A30227DF393300CE8F68 /* LogLevelExtensions.swift in Sources */, 2408A8A42747ED0000D2D1DE /* AppleSearchAdsService.swift in Sources */, D08CE429240D389800A70089 /* KeychainService.swift in Sources */, 7E6EFA4526F89D1C002EED38 /* FavIconService.swift in Sources */, 244419EC2614CF0F009555F3 /* String+NSRange.swift in Sources */, - 655A02361C6B7686000F00D7 /* ACLFileLogger.m in Sources */, + 3DB3A30027DF392F00CE8F68 /* LogLevel.swift in Sources */, 2408A8B42747EDF400D2D1DE /* AdServicesAttributionRecordsRequest.swift in Sources */, - 655A023F1C6B7686000F00D7 /* ACLLogger.m in Sources */, 65C12EF71BD7B05D00FFC71C /* AESharedResources.m in Sources */, C7DD464D2754E19A006E1E6C /* UITraitCollection+Utils.swift in Sources */, + 3DB3A30827DF396900CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, D0611F0D27396E3100124BC4 /* SafariProtectionFiltersDatabaseMigrationHelper.swift in Sources */, 2408A8AB2747ED5D00D2D1DE /* RequestSender.swift in Sources */, - D031A13F219EFC99002C17D9 /* DDMultiFormatter.m in Sources */, 2408A8A82747ED3300D2D1DE /* AdServicesWrapper.swift in Sources */, 2408A8A62747ED1B00D2D1DE /* IAdFrameworkHelper.swift in Sources */, - D031A123219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */, 7E6EFA3F26F88EF9002EED38 /* UITraitEnvironment+Utils.swift in Sources */, B2C8E9902716ECA100ACDED8 /* PurchaseAssistant.swift in Sources */, - D031A0DD219EFC99002C17D9 /* DDOSLogger.m in Sources */, 7E2BA2E926F9D5AD00B44D4A /* ActionExtensionUserRulesHelper.swift in Sources */, 655A02271C6B7686000F00D7 /* ACIOStream.m in Sources */, D06E9BF1269064DC00E5AB5C /* ABECRequest.m in Sources */, 7EF5C52A26C261E5001851D6 /* SharedResources.swift in Sources */, 7E6EFA3526F88C9D002EED38 /* PreloadedFilesManager.swift in Sources */, - D031A0CF219EFC99002C17D9 /* DDTTYLogger.m in Sources */, 2490F64E27006F0A00B1514D /* WebReporterSafariFiltersWrapper.swift in Sources */, 7E18443926F773C70085CDE3 /* SharedResources+Theme.swift in Sources */, 7EF5C56C26C26C42001851D6 /* SharedResources+applicationResources.swift in Sources */, @@ -8771,7 +8644,6 @@ D03E533221B6A4B200C62152 /* UIColorUtils.swift in Sources */, 7E16F2A026FA287B00383410 /* ACNHttpUtils.m in Sources */, 2408A8AE2747ED9500D2D1DE /* HttpRequestServiceProtocol+sendFeedback.swift in Sources */, - D093719821B056BB004A24F1 /* CocoaLumberjack.swift in Sources */, 655A02301C6B7686000F00D7 /* ACLExecuteBlockDelayed.m in Sources */, 7E6EFA2F26F887B9002EED38 /* ServicesInitializer.swift in Sources */, 2490F64B27006CF300B1514D /* WebReporterProtocol.swift in Sources */, @@ -8800,24 +8672,22 @@ D08CE42B240D38AE00A70089 /* LoginResponseParser.swift in Sources */, 2408A8A72747ED2E00D2D1DE /* AdClientWrapper.swift in Sources */, D0611F0B27396C7400124BC4 /* SafariMigration4_3.swift in Sources */, - D031A177219EFC99002C17D9 /* DDFileLogger.m in Sources */, D09E2A9A254AC0D6002D6BC0 /* Bundle+Utils.swift in Sources */, 7E6EFA3326F88C82002EED38 /* SharedStorageUrls.swift in Sources */, 7E40799F231E81C1007EFB26 /* URL+Utils.swift in Sources */, D08CE430240D4B0C00A70089 /* String+Utils.swift in Sources */, 7E2BA2E526F9D3D600B44D4A /* UIViewController+Alert.swift in Sources */, D03E532E21B6A42D00C62152 /* ConfigurationServiceProtocol.swift in Sources */, - D031A15B219EFC99002C17D9 /* DDLoggerNames.m in Sources */, D03E532B21B6A16C00C62152 /* ThemeService.swift in Sources */, + 3DB3A30E27DF39F100CE8F68 /* NativeLoggerWrapper.swift in Sources */, 2408A8AC2747ED6E00D2D1DE /* ParserProtocol.swift in Sources */, + 3DB3A2FD27DF392A00CE8F68 /* LoggerManager.swift in Sources */, D03E533021B6A48800C62152 /* ThemableLabel.swift in Sources */, 655A029F1C6B7686000F00D7 /* ACSSystemUtils.m in Sources */, 2408A8A52747ED1500D2D1DE /* AdServicesHelper.swift in Sources */, 65EC9BCF1BB9824C00F53F3B /* ADLocations.m in Sources */, 655A02871C6B7686000F00D7 /* NSURL+Utils.m in Sources */, - D0977A6D221D8C9700E10AC8 /* ACLLogFileManagerDefault.swift in Sources */, 7EAD353326C2D35E001AFB3A /* NotificationCenter+Utils.swift in Sources */, - D031A107219EFC99002C17D9 /* CLIColor.m in Sources */, 2408A8B12747EDB300D2D1DE /* SuccessFailureParser.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -8848,10 +8718,12 @@ D06ACB6F2146AF1700D2A37D /* LongLabelCell.swift in Sources */, D00E448925650084002DDE98 /* ImportSettingsService.swift in Sources */, 7EE3427224D84A7600A8C0E6 /* AboutViewController.swift in Sources */, - 655A023D1C6B7686000F00D7 /* ACLLogger.m in Sources */, + 3D8EA83027D0CFD900F0172F /* LogLevel.swift in Sources */, 249EC92126F772F300BEF8F0 /* SelectDnsProtocolController.swift in Sources */, 7E1104F922DE27C700720501 /* StartupService.swift in Sources */, + 3DB3A2E227DF374700CE8F68 /* ConsoleAppDestination.swift in Sources */, 7EB2F94823F2B64500F9A544 /* ParserProtocol.swift in Sources */, + 3DB3A25027DF2D6D00CE8F68 /* LoggerManagerImpl.swift in Sources */, D0A235502720569400CE1730 /* SharedResources+customBlockingIps.swift in Sources */, D0DB1B062148DB35006EB991 /* SettingsController.swift in Sources */, 2487C017272AECD900449BC2 /* ImportDNSSettingsHelper.swift in Sources */, @@ -8893,13 +8765,13 @@ 2490F65A2700983D00B1514D /* SuccessFailureParser.swift in Sources */, 24B36A9426F3948800085E7A /* BackgroundFetchUpdateInterval.swift in Sources */, 7EE9F63E26DCC55300646D62 /* FilterDetailsProtocol.swift in Sources */, - D031A171219EFC99002C17D9 /* DDFileLogger.m in Sources */, 7E1BAE72233A1AFF00F1EBEB /* SafariProtectionController.swift in Sources */, 7E50493022F07C4E0095181C /* UIView+Utils.swift in Sources */, D0CDAEA52191C9540028001B /* String+Utils.swift in Sources */, D0611F0A27396C7400124BC4 /* SafariMigration4_3.swift in Sources */, 242A07B126C677D900181D35 /* AdvancedProtectionController.swift in Sources */, 24B36A8F26F393F200085E7A /* SharedResources+BackgroundFetchTimePeriod.swift in Sources */, + 3D8EA81827D0CE4000F0172F /* NativeLoggerWrapperOsLogImpl.swift in Sources */, 24F67F5826E778DB00ABF2BE /* SafariWebExtensionParametersParser.swift in Sources */, 7E2D93FC26F4891D00534DC5 /* Constants+Sentry.swift in Sources */, 655A02251C6B7686000F00D7 /* ACIOStream.m in Sources */, @@ -8909,6 +8781,7 @@ 7EC8A37826E658F5005244CF /* UserRulesRedirectController.swift in Sources */, B2673DC827173DFD00E04747 /* ObsoleteSafariAllowlistRulesWrappers.swift in Sources */, B2673DC627173DFD00E04747 /* SafariProtectionCustomFiltersMigrationHelper.swift in Sources */, + 3D1EA72527DA3539005E7153 /* LogLevelExtensions.swift in Sources */, D00E44522563F2AD002DDE98 /* ImportSettingsViewModel.swift in Sources */, 7E1A8F5826FDBFAF00BA98D5 /* ContentBlockersTableController.swift in Sources */, 247CB5522600AF710047974C /* IURLSchemeExecutor.swift in Sources */, @@ -8918,6 +8791,7 @@ 247CB5192600ADD30047974C /* IURLSchemeParametersParser.swift in Sources */, 7EA2B3252424FE8F00FD3304 /* ActivityTableViewCell.swift in Sources */, D0569E4421F1EBF200985DA9 /* DnsSettingsController.swift in Sources */, + 3D8EA81B27D0CE9300F0172F /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, 7E3BDEE023A15709009492CE /* GetProDialogView.swift in Sources */, 7ED3D37023CCD55C0014734A /* EditBlockRequestController.swift in Sources */, 247CB63A2600CBE40047974C /* OpenTunnelModeControllerParser.swift in Sources */, @@ -8926,10 +8800,8 @@ 247CB5C52600BB1C0047974C /* OpenMainPageControllerParser.swift in Sources */, 2490F6582700983400B1514D /* SendFeedbackRequest.swift in Sources */, 244339712580D8AB00AB4F26 /* BlockingModeController.swift in Sources */, - D031A10F219EFC99002C17D9 /* CocoaLumberjack.swift in Sources */, 247CB6122600C8870047974C /* OpenImportSettingsControllerParser.swift in Sources */, 24B3DAF326F8B50A00A66C0F /* DnsProviderFeatureCell.swift in Sources */, - D031A0D7219EFC99002C17D9 /* DDOSLogger.m in Sources */, D09E9644216CB14A00313AB1 /* ThemeService.swift in Sources */, 244AFB792704A4CA00D628E6 /* ContentSizedTableView.swift in Sources */, 7E92754526C67FCD007B2C80 /* SafariGroupsModel.swift in Sources */, @@ -8950,6 +8822,7 @@ 7EF5C51226C261AF001851D6 /* SharedResources+Statistics.swift in Sources */, 655A02911C6B7686000F00D7 /* ACNNetworking.m in Sources */, 7E2D93F126F3A1DD00534DC5 /* DnsFiltersTableController.swift in Sources */, + 3D1EA72127DA3503005E7153 /* LoggerManager.swift in Sources */, 247CB57B2600B8030047974C /* OpenUserFilterControllerParser.swift in Sources */, D02B550122EED4AF0039BC48 /* Date+Utils.swift in Sources */, 7E50493322F07FFA0095181C /* FilterTagsButtons.swift in Sources */, @@ -8967,7 +8840,6 @@ 2490F64A27006CF300B1514D /* WebReporterProtocol.swift in Sources */, B2673DCE27173DFD00E04747 /* DnsProtectionFiltersMigrationHelper.swift in Sources */, 655A02851C6B7686000F00D7 /* NSURL+Utils.m in Sources */, - D0977A6C221D8B3E00E10AC8 /* ACLLogFileManagerDefault.swift in Sources */, D0A235532720651000CE1730 /* LowlevelSettingsMigrationHelper.swift in Sources */, 7E8C8C4224E19779000B4B9C /* UIImage+Utils.swift in Sources */, 2430CE1426F34D78005A05DA /* BackgroungFetchController.swift in Sources */, @@ -8986,10 +8858,8 @@ 7E822C0F2435EDD30015B4D0 /* BasicRulesParser.swift in Sources */, 7EE740E526F35B0C0033B673 /* UserRulesRedirectAction.swift in Sources */, 24D922802604B41C002F368B /* AppDelegate+CheckPeriod.swift in Sources */, - 655A02341C6B7686000F00D7 /* ACLFileLogger.m in Sources */, 24C31ECE26FF867500673309 /* WebReporterDnsProtectionWrapper.swift in Sources */, D0319F9E21947633002C17D9 /* RuleDetailsController.swift in Sources */, - D031A101219EFC99002C17D9 /* CLIColor.m in Sources */, 7E88A64023E8361A00A10F3A /* SystemProtectionEnablerController.swift in Sources */, 7E2D93F926F4879700534DC5 /* Constants+LocalDnsAddresses.swift in Sources */, B2673DDC2717402C00E04747 /* DnsRequestDetailsContainerController.swift in Sources */, @@ -8997,7 +8867,6 @@ 244339DE2581092900AB4F26 /* UpstreamsController.swift in Sources */, 2422253F26ECB50B00EC74AE /* ChartViewModel.swift in Sources */, 7EAA63992341E8A60040F3A0 /* RuleInfo.swift in Sources */, - D031A147219EFC99002C17D9 /* DDLog.m in Sources */, 7E1A8F6926FDE37200BA98D5 /* ContentBlockerTableViewCellModel.swift in Sources */, C7DD46502754E90C006E1E6C /* PremiumFeaturesPagingView.swift in Sources */, 655A027F1C6B7686000F00D7 /* NSString+Utils.m in Sources */, @@ -9014,7 +8883,6 @@ 7E4CC0522577E8C1005ADBCA /* HideKeyboardTapGestureRecognizer.swift in Sources */, 2408A87F2747ADE400D2D1DE /* AdServicesWrapper.swift in Sources */, 247CB5662600B2F60047974C /* AppDelegate+IURLSchemeExecutor.swift in Sources */, - D031A11D219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */, 7EF5C51126C261AF001851D6 /* SharedResources+DebugLogs.swift in Sources */, 7E40799B231E7E4E007EFB26 /* URL+Utils.swift in Sources */, 655A02161C6B7686000F00D7 /* ACFFileUtils.m in Sources */, @@ -9059,7 +8927,6 @@ D0A614ED26EBA18B00793922 /* BootstrapsHelper.swift in Sources */, 7EC67F6C2548301000FEEEE2 /* ChooseDnsImplementationController.swift in Sources */, 2491F74126F63AF5006CF561 /* DnsProviderDetailsModel.swift in Sources */, - D031A0C9219EFC99002C17D9 /* DDTTYLogger.m in Sources */, 65EBC2511BC2D25E00788D98 /* AEUILongLabelViewCell.m in Sources */, 7E3FEFB126CD37750080EC03 /* AGSearchView.swift in Sources */, 7E822C112435EDD30015B4D0 /* ParsedHost.swift in Sources */, @@ -9080,7 +8947,6 @@ 655E94961BBEB31400286FBE /* AEUIPlayerViewController.m in Sources */, B2673DE2271740C600E04747 /* SettingsResetService.swift in Sources */, 658E43981E8911A3008DAA59 /* NSStringPunycodeAdditions.m in Sources */, - D031A139219EFC99002C17D9 /* DDMultiFormatter.m in Sources */, 7E15DFD726E63A460020247E /* UIDevice+Utils.swift in Sources */, 7E822C0E2435EDD30015B4D0 /* RulesParser.swift in Sources */, 247432DE261731C00025C7B8 /* UIAlerController+Style.swift in Sources */, @@ -9108,7 +8974,6 @@ 24B3DAEF26F8B4D000A66C0F /* DnsProviderActionCell.swift in Sources */, 7E303C2126F6463400EBACD1 /* DnsFiltersModelsProvider.swift in Sources */, 240C3AE02746775800CD10B3 /* AdClientWrapper.swift in Sources */, - D031A163219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */, 7EF5C51326C261AF001851D6 /* SharedResources.swift in Sources */, 7E85A82326F37FBD0059BB33 /* OpenLicenseControllerParser.swift in Sources */, 24C31EC226FF703800673309 /* ApplicationWebReporter.swift in Sources */, @@ -9124,6 +8989,7 @@ 2490F65F27009E7300B1514D /* RequestFactory.swift in Sources */, D07373A226EB5F0A007366F8 /* LowLevelDnsConfiguration+Utils.swift in Sources */, 240C3ADA27464B7C00CD10B3 /* AppleSearchAdsService.swift in Sources */, + 3DB3A31027DF3CA800CE8F68 /* AGLoggerExtensions.swift in Sources */, 7EA887E9237D290E00E1043D /* CustomNavigationTransition.swift in Sources */, 7E5101932355B53700935FE9 /* NetworkSettingsModel.swift in Sources */, 7EDA07C02720490100D2AF86 /* SDKMigrationOldFilesHelper.swift in Sources */, @@ -9139,7 +9005,6 @@ 655A029D1C6B7686000F00D7 /* ACSSystemUtils.m in Sources */, 7E70266026DD28C600F8FC25 /* SafariUserRulesTableModel.swift in Sources */, 7E3FEFBD26CEB4E90080EC03 /* Bool+Utils.swift in Sources */, - D031A12B219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */, 7EB55270242247E2000498CC /* ActivityStatisticsModel.swift in Sources */, 7EE8AC1626C595350070D477 /* ThemeMode.swift in Sources */, 2463A7A42746B1BA007C9935 /* IAdFrameworkHelper.swift in Sources */, @@ -9161,6 +9026,7 @@ D083ADAB2732BC3500A8F96E /* MigrationStateManager.swift in Sources */, D07A164221678EA5008BB432 /* RoundrectView.swift in Sources */, D0BDDD27215AAF43000C85F1 /* AddCustomFilterController.swift in Sources */, + 3DB3A2EF27DF387300CE8F68 /* LoggerManagerExtensions.swift in Sources */, 7EF5C57226C26E18001851D6 /* EdgeInsetLabel.swift in Sources */, 24B3DAED26F8B4B400A66C0F /* DnsProviderHeaderCell.swift in Sources */, D00E441B2562A4B0002DDE98 /* ImportSettingsCell.swift in Sources */, @@ -9175,6 +9041,7 @@ 24AD872D260A247B0034D402 /* RadioButton.swift in Sources */, 7EAA0D8A26CA9B35007208E5 /* SafariGroupFiltersModelsProvider.swift in Sources */, B2673DCA27173DFD00E04747 /* SafariProtectionAllowlistRulesMigrationHelper.swift in Sources */, + 3D8EA81E27D0CEBA00F0172F /* NativeLoggerWrapper.swift in Sources */, 24B33CFD26C5073700499281 /* OnboardingContentView.swift in Sources */, 24D9225B2604B28B002F368B /* AppDelegate+UserNotifications.swift in Sources */, D09E2A98254AC0D5002D6BC0 /* Bundle+Utils.swift in Sources */, @@ -9187,7 +9054,6 @@ 7E70266926DE462D00F8FC25 /* UserRuleTableViewCell.swift in Sources */, 7E303C1E26F632A900EBACD1 /* DnsFilterCell.swift in Sources */, 7E74FCAC239F9BF7006C0990 /* MainPageController.swift in Sources */, - D031A155219EFC99002C17D9 /* DDLoggerNames.m in Sources */, 2414089D26C42E6700741F32 /* OnboardingAdvancedProtectionView.swift in Sources */, 7E3556D625DBEB7500CB2A8D /* UIViewController+Present.swift in Sources */, 7E9C0BCD25627E8D00F1999D /* UIColor+Utils.swift in Sources */, @@ -9206,7 +9072,6 @@ buildActionMask = 2147483647; files = ( 249E11462600D389003A5FBD /* OpenDnsProvidersControllerWithSDNSParser.swift in Sources */, - D0288F41230699A900A4EBEF /* ACLFileLogger.m in Sources */, B26B927B2719B46F00F1D482 /* SDKMigrationsDirectoriesManager.swift in Sources */, B26B92972719BAF100F1D482 /* SafariProtectionAllowlistRulesMigrationHelper.swift in Sources */, 7E8576642435F1F70055F63D /* Rule.swift in Sources */, @@ -9280,7 +9145,6 @@ 241819FD2594D76900380A8A /* QueryParametersFromURLStringTest.swift in Sources */, D0288F31230697C800A4EBEF /* ACLFileLocker.m in Sources */, 24F66A9C26033DA00097B426 /* OpenMainPageControllerControllerWithLaunchScreenParser.swift in Sources */, - D0288F2E2306974F00A4EBEF /* DDLog.m in Sources */, 240C3B392746AB1100CD10B3 /* SendFeedbackRequest.swift in Sources */, 240C3B292746A49A00CD10B3 /* AppleSearchAdsServiceTest.swift in Sources */, 240C3B352746AAB900CD10B3 /* RequestSender.swift in Sources */, @@ -9290,11 +9154,9 @@ 249E11582600D38B003A5FBD /* OpenImportSettingsControllerParser.swift in Sources */, 240F6F322732C14000FD5430 /* ImportDNSSettingsHelperTest.swift in Sources */, D0EC86B523A7738E00EDF107 /* VpnManagerMock.swift in Sources */, - D0288F3F2306997D00A4EBEF /* DDFileLogger.m in Sources */, 2408A8832747D47B00D2D1DE /* AdServicesAttributionRecordsParserTest.swift in Sources */, D0288F39230698D300A4EBEF /* ACNHttpUtils.m in Sources */, 7E8576672435F1F70055F63D /* ParsedHost.swift in Sources */, - D03E532A21B41FF000C62152 /* CocoaLumberjack.swift in Sources */, D09E2D56255D7633002D6BC0 /* SettingsParserTest.swift in Sources */, 2488C4532735800400BA6918 /* ImportSafariProtectionSettingsHelperMock.swift in Sources */, 7E5844DB23FD88E700BAD052 /* UserNotificationServiceMock.swift in Sources */, @@ -9328,7 +9190,6 @@ 7E774CB62720633100A970C1 /* DnsStatisticsMigrationHelperTests.swift in Sources */, D0AEC26B24093364003E8FCC /* APCommonSharedResources.m in Sources */, B26B92832719B72700F1D482 /* PurchaseServiceProtocol.swift in Sources */, - D0288F3E2306996E00A4EBEF /* DDOSLogger.m in Sources */, 2449000D272C3E5E00557CEE /* ImportDNSSettingsHelper.swift in Sources */, 7ED0D64F23D59797004D9E7C /* UIButton+UtilsTest.swift in Sources */, 240C3B322746AA6C00CD10B3 /* RequestSenderProtocol.swift in Sources */, @@ -9338,7 +9199,6 @@ D0288F382306985000A4EBEF /* ACNCidrRange.m in Sources */, 240C3B382746AB0900CD10B3 /* AdServicesAttributionRecordsParser.swift in Sources */, 7ED0D65023D598A1004D9E7C /* UIButton+Utils.swift in Sources */, - D0288F42230699CF00A4EBEF /* DDLoggerNames.m in Sources */, D0F911932136DAB0006DF0D3 /* PurchaseService.swift in Sources */, D0A2354E27201D0D00CE1730 /* DnsStatisticsMigrationHelper.swift in Sources */, 7ED0B1A426C4334D00B0CE7B /* SharedStorageUrls.swift in Sources */, @@ -9364,7 +9224,6 @@ 246EE285275FBEAF00104CE4 /* Domain.swift in Sources */, 2411AA292733F6F500E82F2E /* SafariProtectionMock.swift in Sources */, D0F5F87625E941B1004E4A82 /* VpnConfigurationStatus.swift in Sources */, - D0288F3D2306995800A4EBEF /* ACLLogger.m in Sources */, 7EF5C55226C26226001851D6 /* SharedResources+Statistics.swift in Sources */, 240F6F342732C16500FD5430 /* ImportSafariProtectionSettingsHelperTest.swift in Sources */, 2408A8812747AF9A00D2D1DE /* AdServicesWrapperMock.swift in Sources */, @@ -9372,7 +9231,6 @@ D0D7E62D2444C412001801A5 /* ACSSystemUtils.m in Sources */, B26B92922719BA8900F1D482 /* SafariProtectionCustomFiltersMigrationHelper.swift in Sources */, B26B92882719B77600F1D482 /* SafariProtectionFiltersDatabaseMigrationHelper.swift in Sources */, - D0288F402306998600A4EBEF /* DDTTYLogger.m in Sources */, 249E125E2600FFA3003A5FBD /* URLSchemeExecutorMock.swift in Sources */, 7E5844D823FD87E900BAD052 /* RateAppServiceTest.swift in Sources */, 2449000C272C3E5800557CEE /* ImportSafariProtectionSettingsHelper.swift in Sources */, @@ -9402,50 +9260,45 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D031A12C219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */, 655A02291C6B7686000F00D7 /* ACIOUtils.m in Sources */, D083AD7A27301DC600A8F96E /* SharedResources.swift in Sources */, 65EC9CC81BB9841400F53F3B /* ADProductInfo.m in Sources */, D07256EE26BD579100654177 /* Bundle+Utils.swift in Sources */, - D031A0CA219EFC99002C17D9 /* DDTTYLogger.m in Sources */, + 3DB3A2E027DF371000CE8F68 /* LogLevelExtensions.swift in Sources */, 655A029E1C6B7686000F00D7 /* ACSSystemUtils.m in Sources */, 7EF5C51426C261BF001851D6 /* SharedResources+DebugLogs.swift in Sources */, 655A02801C6B7686000F00D7 /* NSString+Utils.m in Sources */, - D031A172219EFC99002C17D9 /* DDFileLogger.m in Sources */, 655A024D1C6B7686000F00D7 /* ACLWildcard.m in Sources */, 7E9C0C1D256292DE00F1999D /* UIColor+Utils.swift in Sources */, D083AD7C27313FC100A8F96E /* ContentBlockerMigrationService.swift in Sources */, - 655A02351C6B7686000F00D7 /* ACLFileLogger.m in Sources */, D07256DB26BD556200654177 /* ContentBlockerRequestHandler.swift in Sources */, + 3DB3A25127DF2EB000CE8F68 /* LoggerManagerImpl.swift in Sources */, + 3DB3A26327DF2F7700CE8F68 /* ConsoleAppDestination.swift in Sources */, 655A022F1C6B7686000F00D7 /* ACLExecuteBlockDelayed.m in Sources */, 655A027A1C6B7686000F00D7 /* NSException+Utils.m in Sources */, 655A02921C6B7686000F00D7 /* ACNNetworking.m in Sources */, - D031A156219EFC99002C17D9 /* DDLoggerNames.m in Sources */, 655A02321C6B7686000F00D7 /* ACLFileLocker.m in Sources */, 655A02171C6B7686000F00D7 /* ACFFileUtils.m in Sources */, - D031A11E219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */, - D031A0D8219EFC99002C17D9 /* DDOSLogger.m in Sources */, + 3DB3A29D27DF31AA00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, 655A02261C6B7686000F00D7 /* ACIOStream.m in Sources */, 655A02861C6B7686000F00D7 /* NSURL+Utils.m in Sources */, D05CA86E1F3B6455006DFD7F /* APCommonSharedResources.m in Sources */, D083AD89273140A100A8F96E /* SDKMigrationOldFilesHelper.swift in Sources */, - D031A13A219EFC99002C17D9 /* DDMultiFormatter.m in Sources */, - D031A148219EFC99002C17D9 /* DDLog.m in Sources */, D083AD962731413400A8F96E /* SharedStorageUrls.swift in Sources */, 65EC9CC71BB9841400F53F3B /* ADLocations.m in Sources */, + 3DB3A25727DF2EB600CE8F68 /* LogLevel.swift in Sources */, D07D33F626121F4D00213A5A /* Dictionary+Utils.swift in Sources */, 655A02771C6B7686000F00D7 /* NSDate+Utils.m in Sources */, - 655A023E1C6B7686000F00D7 /* ACLLogger.m in Sources */, 65AD3BBC1B7CB15400004A02 /* AESharedResources.m in Sources */, D08CE432240D4BD000A70089 /* String+Utils.swift in Sources */, 24F55248258753C900AF1D3B /* DNSSettings.swift in Sources */, - D093719321B056B7004A24F1 /* CocoaLumberjack.swift in Sources */, D07D34DA2612259C00213A5A /* CharacterSet+Utils.swift in Sources */, D083AD5D27301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, 655A028F1C6B7686000F00D7 /* ACNHttpUtils.m in Sources */, + 3DB3A28F27DF315F00CE8F68 /* NativeLoggerWrapper.swift in Sources */, D08CE438240D4C5D00A70089 /* UIColorUtils.swift in Sources */, - D031A102219EFC99002C17D9 /* CLIColor.m in Sources */, - D031A164219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */, + 3DB3A2B627DF31E100CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, + 3DB3A25D27DF2EBE00CE8F68 /* LoggerManager.swift in Sources */, 65EC9CC61BB9841400F53F3B /* ADLocales.m in Sources */, 655A02A41C6B7686000F00D7 /* Reachability.m in Sources */, 24441A102614CF27009555F3 /* String+NSRange.swift in Sources */, @@ -9456,50 +9309,45 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 7E06B66722FB1606006859AC /* DDDispatchQueueLogFormatter.m in Sources */, 7E06B66822FB1606006859AC /* ACIOUtils.m in Sources */, D083AD7527301DC300A8F96E /* SharedResources.swift in Sources */, 7E06B66922FB1606006859AC /* ADProductInfo.m in Sources */, D07256E926BD578F00654177 /* Bundle+Utils.swift in Sources */, - 7E06B66B22FB1606006859AC /* DDTTYLogger.m in Sources */, + 3DB3A2DC27DF370D00CE8F68 /* LogLevelExtensions.swift in Sources */, 7E06B66C22FB1606006859AC /* ACSSystemUtils.m in Sources */, 7EF5C51A26C261CA001851D6 /* SharedResources+DebugLogs.swift in Sources */, - 7E06B66E22FB1606006859AC /* DDFileLogger.m in Sources */, 7E06B66F22FB1606006859AC /* ACLWildcard.m in Sources */, 7E9C0C33256292E100F1999D /* UIColor+Utils.swift in Sources */, - 7E06B67022FB1606006859AC /* ACLFileLogger.m in Sources */, D083AD8127313FC100A8F96E /* ContentBlockerMigrationService.swift in Sources */, 7E06B67122FB1606006859AC /* ACLExecuteBlockDelayed.m in Sources */, D07256E026BD556500654177 /* ContentBlockerRequestHandler.swift in Sources */, + 3DB3A25627DF2EB300CE8F68 /* LoggerManagerImpl.swift in Sources */, + 3DB3A26827DF2F7A00CE8F68 /* ConsoleAppDestination.swift in Sources */, 7E06B67222FB1606006859AC /* NSException+Utils.m in Sources */, 7E06B67322FB1606006859AC /* ACNNetworking.m in Sources */, - 7E06B67422FB1606006859AC /* DDLoggerNames.m in Sources */, 7E06B67522FB1606006859AC /* ACLFileLocker.m in Sources */, 7E06B67622FB1606006859AC /* ACFFileUtils.m in Sources */, - 7E06B67722FB1606006859AC /* DDContextFilterLogFormatter.m in Sources */, - 7E06B67922FB1606006859AC /* DDOSLogger.m in Sources */, 7E06B67A22FB1606006859AC /* ACIOStream.m in Sources */, + 3DB3A2A227DF31AC00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, 7E06B67B22FB1606006859AC /* NSURL+Utils.m in Sources */, 7E06B67C22FB1606006859AC /* APCommonSharedResources.m in Sources */, - 7E06B67D22FB1606006859AC /* DDMultiFormatter.m in Sources */, D083AD8E273140A400A8F96E /* SDKMigrationOldFilesHelper.swift in Sources */, - 7E06B67E22FB1606006859AC /* DDLog.m in Sources */, 7E06B67F22FB1606006859AC /* ADLocations.m in Sources */, D083AD9B2731413800A8F96E /* SharedStorageUrls.swift in Sources */, D07D33F526121F4D00213A5A /* Dictionary+Utils.swift in Sources */, + 3DB3A25C27DF2EB900CE8F68 /* LogLevel.swift in Sources */, 7E06B68022FB1606006859AC /* NSDate+Utils.m in Sources */, D0450F80263C2A1400CA2110 /* NSString+Utils.m in Sources */, - 7E06B68122FB1606006859AC /* ACLLogger.m in Sources */, 7E06B68322FB1606006859AC /* AESharedResources.m in Sources */, D08CE437240D4BD300A70089 /* String+Utils.swift in Sources */, 24F5525E258753CD00AF1D3B /* DNSSettings.swift in Sources */, - 7E06B68422FB1606006859AC /* CocoaLumberjack.swift in Sources */, D07D34C42612259800213A5A /* CharacterSet+Utils.swift in Sources */, D083AD6227301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, 7E06B68522FB1606006859AC /* ACNHttpUtils.m in Sources */, + 3DB3A29427DF316200CE8F68 /* NativeLoggerWrapper.swift in Sources */, D08CE43D240D4C6000A70089 /* UIColorUtils.swift in Sources */, - 7E06B68622FB1606006859AC /* CLIColor.m in Sources */, - 7E06B68722FB1606006859AC /* DDAbstractDatabaseLogger.m in Sources */, + 3DB3A2B227DF31DE00CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, + 3DB3A26227DF2EC200CE8F68 /* LoggerManager.swift in Sources */, 7E06B68822FB1606006859AC /* ADLocales.m in Sources */, 7E06B68922FB1606006859AC /* Reachability.m in Sources */, 24441A162614CF2A009555F3 /* String+NSRange.swift in Sources */, @@ -9512,28 +9360,28 @@ files = ( 7E18443126F76B4D0085CDE3 /* ThemeMode.swift in Sources */, 7EC8A40626E78D77005244CF /* Bundle+Utils.swift in Sources */, - 7EBDD98926D6A2E9009531FA /* DDLog.m in Sources */, 7E85A82626F3928F0059BB33 /* ADProductInfo.m in Sources */, 7EBDD98226D6A1F2009531FA /* Message.swift in Sources */, + 3DB3A2C927DF33D100CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, 7EBDD98E26D6A318009531FA /* ACLFileLocker.m in Sources */, 7E18443626F773470085CDE3 /* SharedResources+Theme.swift in Sources */, - 7EBDD99326D6A351009531FA /* ACLFileLogger.m in Sources */, 494E0BBB26E7AF4A005C21C4 /* SharedStorageUrls.swift in Sources */, 7E497E1A26E202E90072BDE1 /* ChunkFileReader.swift in Sources */, - 7EBDD98C26D6A2FA009531FA /* ACLLogger.m in Sources */, 7EC8A41026E7998F005244CF /* Services.swift in Sources */, - 7EBDD98626D6A26C009531FA /* CocoaLumberjack.swift in Sources */, - 7EBDD99726D6A37D009531FA /* DDTTYLogger.m in Sources */, + 3DB3A28727DF304200CE8F68 /* ConsoleAppDestination.swift in Sources */, 7E9EBDD926EAA6EA00B5FEC3 /* SharedResources+DebugLogs.swift in Sources */, - 7EBDD99526D6A36C009531FA /* DDLoggerNames.m in Sources */, + 3DB3A29527DF316600CE8F68 /* NativeLoggerWrapper.swift in Sources */, 7EBDD97D26D6A1D0009531FA /* SafariWebExtensionMessageProcessor.swift in Sources */, 7EC3368E26FB9B9E002AF24A /* URL+Utils.swift in Sources */, 7EBDD97F26D6A1D0009531FA /* SafariWebExtensionHandler.swift in Sources */, + 3DB3A28427DF2FE700CE8F68 /* LogLevel.swift in Sources */, 7EDACF8F26ED2B4C00C7EE63 /* SharedResources.swift in Sources */, + 3DB3A28627DF2FEC00CE8F68 /* LoggerManagerImpl.swift in Sources */, + 3DB3A28227DF2FE100CE8F68 /* LoggerManager.swift in Sources */, 7EC8A40D26E7919D005244CF /* UserRulesRedirectAction.swift in Sources */, - 7EBDD99126D6A344009531FA /* DDOSLogger.m in Sources */, - 7EBDD99026D6A32F009531FA /* DDFileLogger.m in Sources */, + 3DB3A2D227DF370400CE8F68 /* LogLevelExtensions.swift in Sources */, 7EBDD98826D6A2E2009531FA /* AESharedResources.m in Sources */, + 3DB3A32B27DF447800CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -9543,28 +9391,28 @@ files = ( 7E18443026F76B4B0085CDE3 /* ThemeMode.swift in Sources */, 7EC8A40526E78D76005244CF /* Bundle+Utils.swift in Sources */, - 7EBDD98A26D6A2EA009531FA /* DDLog.m in Sources */, 7E85A82526F3928E0059BB33 /* ADProductInfo.m in Sources */, 7EBDD98326D6A1F2009531FA /* Message.swift in Sources */, 7EBDD98D26D6A318009531FA /* ACLFileLocker.m in Sources */, 7E18443826F773470085CDE3 /* SharedResources+Theme.swift in Sources */, - 7EBDD99426D6A352009531FA /* ACLFileLogger.m in Sources */, 494E0BBA26E7AF49005C21C4 /* SharedStorageUrls.swift in Sources */, 7E497E1B26E202E90072BDE1 /* ChunkFileReader.swift in Sources */, - 7EBDD98B26D6A2FA009531FA /* ACLLogger.m in Sources */, + 3DB3A2FB27DF38C200CE8F68 /* LoggerManagerImpl.swift in Sources */, 7EC8A41126E7998F005244CF /* Services.swift in Sources */, - 7EBDD98526D6A26B009531FA /* CocoaLumberjack.swift in Sources */, - 7EBDD99826D6A37E009531FA /* DDTTYLogger.m in Sources */, + 3DB3A28827DF304300CE8F68 /* ConsoleAppDestination.swift in Sources */, 7E9EBDDA26EAA6EB00B5FEC3 /* SharedResources+DebugLogs.swift in Sources */, - 7EBDD99626D6A36C009531FA /* DDLoggerNames.m in Sources */, + 3DB3A29627DF316800CE8F68 /* NativeLoggerWrapper.swift in Sources */, + 3DB3A2C627DF33CD00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, 7EBDD97E26D6A1D0009531FA /* SafariWebExtensionMessageProcessor.swift in Sources */, 7EC3368D26FB9B9C002AF24A /* URL+Utils.swift in Sources */, 7EBDD98026D6A1D0009531FA /* SafariWebExtensionHandler.swift in Sources */, + 3DB3A28327DF2FE500CE8F68 /* LogLevel.swift in Sources */, 7EDACF8E26ED2B4A00C7EE63 /* SharedResources.swift in Sources */, + 3DB3A28127DF2FDF00CE8F68 /* LoggerManager.swift in Sources */, 7EC8A40E26E7919D005244CF /* UserRulesRedirectAction.swift in Sources */, - 7EBDD99226D6A345009531FA /* DDOSLogger.m in Sources */, - 7EBDD98F26D6A32F009531FA /* DDFileLogger.m in Sources */, + 3DB3A2D027DF36F900CE8F68 /* LogLevelExtensions.swift in Sources */, 7EBDD98726D6A2E2009531FA /* AESharedResources.m in Sources */, + 3DB3A32C27DF447B00CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -9575,7 +9423,6 @@ 2408A8922747E55100D2D1DE /* RequestSender.swift in Sources */, D0A23547271ED4AE00CE1730 /* DnsProvidersManagerProtocol+ServerName.swift in Sources */, B2C19E5E2716BA2B00331109 /* TodayViewController.swift in Sources */, - B2C8E9852716E97F00ACDED8 /* DDTTYLogger.m in Sources */, 7E174BF6271F13EB006B7271 /* PurchaseService.swift in Sources */, 2408A89C2747E6DC00D2D1DE /* SendFeedbackRequest.swift in Sources */, B2C19E5F2716BA2E00331109 /* ServiceInitializer.swift in Sources */, @@ -9587,20 +9434,19 @@ 2408A88C2747E4C500D2D1DE /* AdServicesHelper.swift in Sources */, B2C19E622716BD4F00331109 /* AESharedResources.h in Sources */, 2408A8972747E67C00D2D1DE /* ParserProtocol.swift in Sources */, + 3D1EA72927DA3594005E7153 /* LoggerManagerImpl.swift in Sources */, B2C19E632716BD6E00331109 /* AESharedResources.m in Sources */, B2C19E652716BD9500331109 /* ThemeMode.swift in Sources */, + 3D1EA72227DA3506005E7153 /* LoggerManager.swift in Sources */, B2C19E662716BDAA00331109 /* VpnManager.swift in Sources */, D083AD6327301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, B2C8E9802716E91200ACDED8 /* ADLocales.m in Sources */, - B2C8E9872716E99700ACDED8 /* DDLoggerNames.m in Sources */, B2C19E682716BE1000331109 /* VpnConfigurationStatus.swift in Sources */, - B2C8E97F2716E90100ACDED8 /* DDFileLogger.m in Sources */, B2C8E9892716E9FF00ACDED8 /* NSString+Utils.m in Sources */, - B2C8E9822716E92700ACDED8 /* ACLLogger.m in Sources */, B2C19E692716BE2600331109 /* NotificationCenter+Utils.swift in Sources */, + 3D1EA72B27DA35B9005E7153 /* ConsoleAppDestination.swift in Sources */, B2C19E6A2716BE3900331109 /* SharedResources.swift in Sources */, 7E6AD39E271F15E300BCEA7F /* ABECRequest.m in Sources */, - B2C8E9842716E96600ACDED8 /* DDOSLogger.m in Sources */, B2C19E6B2716BE4800331109 /* SharedResources+applicationResources.swift in Sources */, B2C8E97A2716E62100ACDED8 /* SafariConfiguration+Initializers.swift in Sources */, 7E6AD39A271F15A400BCEA7F /* LoginResponseParser.swift in Sources */, @@ -9609,29 +9455,29 @@ B2C8E97B2716E63300ACDED8 /* UIDevice+Utils.swift in Sources */, B2C19E762716C51300331109 /* SharedResources+Theme.swift in Sources */, B2C8E97C2716E80D00ACDED8 /* DnsConfiguration+Initializers.swift in Sources */, + 3D1EA71B27DA2D35005E7153 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, 2408A88F2747E4FC00D2D1DE /* AdClientWrapper.swift in Sources */, B2C8E97C2716E80D00ACDED8 /* DnsConfiguration+Initializers.swift in Sources */, 2408A8992747E6A900D2D1DE /* SupportService+Feedback.swift in Sources */, B2C8E9812716E91A00ACDED8 /* ADProductInfo.m in Sources */, B2C19E6E2716BE9000331109 /* SharedResources+DebugLogs.swift in Sources */, + 3D1EA6E927DA034C005E7153 /* LogLevel.swift in Sources */, B2C19E6C2716BE5800331109 /* NetworkSettingsService.swift in Sources */, B2C19E6D2716BE7100331109 /* Bundle+Utils.swift in Sources */, B2C19E722716BEE700331109 /* DispatchQueue+Utils.swift in Sources */, B2C19E6F2716BEA800331109 /* Date+Utils.swift in Sources */, 2408A8A32747ECD000D2D1DE /* RequestFactory.swift in Sources */, + 3D1EA71927DA2CEB005E7153 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, 2408A89B2747E6CC00D2D1DE /* AdServicesAttributionRecordsParser.swift in Sources */, B2C8E98A2716EA0800ACDED8 /* APCommonSharedResources.m in Sources */, 2408A8942747E5FA00D2D1DE /* RequestProtocol.swift in Sources */, B2C19E732716BEF900331109 /* String+NSRange.swift in Sources */, B2C19E642716BD8100331109 /* ConfigurationServiceProtocol.swift in Sources */, - B2C8E9862716E98700ACDED8 /* ACLFileLogger.m in Sources */, 2408A89D2747E6E400D2D1DE /* AdServicesAttributionRecordsRequest.swift in Sources */, B2C19E712716BED500331109 /* String+Utils.swift in Sources */, 2408A88E2747E4E900D2D1DE /* HttpRequestService.swift in Sources */, 7E6AD39D271F15C900BCEA7F /* PurchaseServiceProtocol.swift in Sources */, - B2C19E702716BEC400331109 /* CocoaLumberjack.swift in Sources */, B2C8E9882716E9AA00ACDED8 /* ACNNetworking.m in Sources */, - B2C8E97E2716E8E700ACDED8 /* DDLog.m in Sources */, B2C8E9832716E93A00ACDED8 /* ACLFileLocker.m in Sources */, 2408A8902747E51400D2D1DE /* AdServicesWrapper.swift in Sources */, 2408A8912747E53F00D2D1DE /* RequestSenderProtocol.swift in Sources */, @@ -9641,7 +9487,9 @@ B2C19E772716C53F00331109 /* UIColorUtils.swift in Sources */, 2408A89A2747E6C400D2D1DE /* SuccessFailureParser.swift in Sources */, 2408A8932747E5C300D2D1DE /* HttpRequestServiceProtocol+sendFeedback.swift in Sources */, + 3D1EA72727DA353C005E7153 /* LogLevelExtensions.swift in Sources */, B2C19E782716C81300331109 /* NativeDnsSettingsManager.swift in Sources */, + 3D1EA71727DA2CCE005E7153 /* NativeLoggerWrapper.swift in Sources */, 2408A88B2747E3D000D2D1DE /* AppleSearchAdsService.swift in Sources */, B2C19E792716D0CB00331109 /* ConfigurationService.swift in Sources */, ); @@ -9657,25 +9505,25 @@ 605E812D27A7F1F200AFC107 /* Bundle+Utils.swift in Sources */, 605E812A27A7DC2300AFC107 /* URL+CustomSchemeURLParserProtocol.swift in Sources */, 7E6081F926D561C700D778F4 /* UserNotificationService.swift in Sources */, - 7E60821426D5638200D778F4 /* DDTTYLogger.m in Sources */, - 7E60820626D562BC00D778F4 /* CocoaLumberjack.swift in Sources */, + 3DB3A2C127DF32D400CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, 7E6081D626D55C0100D778F4 /* YouTubeAdsRequestHandler.swift in Sources */, - 7E60821626D5638B00D778F4 /* ACLFileLogger.m in Sources */, + 3DB3A2BA27DF329800CE8F68 /* LogLevel.swift in Sources */, 7E6081F426D55F3600D778F4 /* SharedResources+DebugLogs.swift in Sources */, - 7E6081FF26D562A200D778F4 /* DDFileLogger.m in Sources */, + 3DB3A2BF27DF32BE00CE8F68 /* ConsoleAppDestination.swift in Sources */, + 3DB3A2D127DF370400CE8F68 /* LogLevelExtensions.swift in Sources */, 7E60820826D5630300D778F4 /* String+NSRange.swift in Sources */, 7E60821926D5639200D778F4 /* ACLFileLocker.m in Sources */, - 7E60820B26D5633D00D778F4 /* DDLoggerNames.m in Sources */, - 7E60821226D5637900D778F4 /* DDOSLogger.m in Sources */, + 3DB3A2BC27DF329B00CE8F68 /* LoggerManagerImpl.swift in Sources */, 7E60820E26D5634E00D778F4 /* AESharedResources.m in Sources */, - 7E60820A26D5633000D778F4 /* ACLLogger.m in Sources */, - 7E60820426D562B700D778F4 /* DDLog.m in Sources */, + 3DB3A2B927DF329500CE8F68 /* LoggerManager.swift in Sources */, 7E6081F526D5618D00D778F4 /* String+Utils.swift in Sources */, + 3DB3A2CA27DF33D400CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, 7E6081F726D561B600D778F4 /* UIColor+Utils.swift in Sources */, 7E6081FD26D5625100D778F4 /* UIColorUtils.swift in Sources */, 7E60821026D5635700D778F4 /* NSString+Utils.m in Sources */, C2326FC77E493BF8F83DB91E /* YouTubeShareLinkResult.swift in Sources */, C232DDD053E035F5575DC231 /* YouTubeAdsJsResult.swift in Sources */, + 3DB3A2C327DF33C200CE8F68 /* NativeLoggerWrapper.swift in Sources */, C23932418213BF73AC1E5BAD /* YoutubeHtmlBuilder.swift in Sources */, C231E086502F0395EC2EE947 /* YoutubePlayerController.swift in Sources */, ); @@ -9688,22 +9536,22 @@ 6089DFC427A8432C00536667 /* UIViewController+Alert.swift in Sources */, 6089DFC227A83CFF00536667 /* DispatchQueue+Utils.swift in Sources */, 605E812F27A7F39600AFC107 /* URL+Utils.swift in Sources */, + 3DB3A2C727DF33CE00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, 605E812C27A7F1E500AFC107 /* Bundle+Utils.swift in Sources */, 605E812B27A7DC2D00AFC107 /* URL+CustomSchemeURLParserProtocol.swift in Sources */, + 3DB3A2FC27DF38F000CE8F68 /* LogLevel.swift in Sources */, 7E6081FB26D561CB00D778F4 /* UserNotificationService.swift in Sources */, - 7E60821326D5638100D778F4 /* DDTTYLogger.m in Sources */, - 7E60820526D562BB00D778F4 /* CocoaLumberjack.swift in Sources */, + 3DB3A2C227DF33C100CE8F68 /* NativeLoggerWrapper.swift in Sources */, 7E6081EE26D55F0000D778F4 /* YouTubeAdsRequestHandler.swift in Sources */, - 7E60821726D5638B00D778F4 /* ACLFileLogger.m in Sources */, 7E6081F326D55F3600D778F4 /* SharedResources+DebugLogs.swift in Sources */, - 7E6081FE26D562A100D778F4 /* DDFileLogger.m in Sources */, + 3DB3A2FA27DF38C200CE8F68 /* LoggerManagerImpl.swift in Sources */, 7E60820726D5630300D778F4 /* String+NSRange.swift in Sources */, 7E60821A26D5639200D778F4 /* ACLFileLocker.m in Sources */, - 7E60820C26D5633E00D778F4 /* DDLoggerNames.m in Sources */, - 7E60821126D5637900D778F4 /* DDOSLogger.m in Sources */, + 3DB3A2D427DF370700CE8F68 /* LogLevelExtensions.swift in Sources */, 7E60820D26D5634D00D778F4 /* AESharedResources.m in Sources */, - 7E60820926D5633000D778F4 /* ACLLogger.m in Sources */, - 7E60820326D562B600D778F4 /* DDLog.m in Sources */, + 3DB3A2C027DF32D200CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, + 3DB3A2B827DF329400CE8F68 /* LoggerManager.swift in Sources */, + 3DB3A2BE27DF32BD00CE8F68 /* ConsoleAppDestination.swift in Sources */, 7E6081F626D5618D00D778F4 /* String+Utils.swift in Sources */, 7E6081F826D561B700D778F4 /* UIColor+Utils.swift in Sources */, 7E6081FC26D5625100D778F4 /* UIColorUtils.swift in Sources */, @@ -9719,34 +9567,36 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - B22FCDB0270B8CA500B1C935 /* DDLog.m in Sources */, + 3D1EA70F27DA2C03005E7153 /* NativeLoggerWrapper.swift in Sources */, + 3DB3A2E127DF371100CE8F68 /* LogLevelExtensions.swift in Sources */, B22FCD9E270B7DFA00B1C935 /* TunnelProvider.swift in Sources */, - B22FCDAE270B8C5A00B1C935 /* DDFileLogger.m in Sources */, D083ADBC27394D1B00A8F96E /* DnsProtectionCustomProvidersMigrationHelper.swift in Sources */, - B22FCDB7270B8DD300B1C935 /* DDOSLogger.m in Sources */, D083AD5C27301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, - B22FCDB6270B8DAC00B1C935 /* DDTTYLogger.m in Sources */, D083ADC327394DBE00A8F96E /* FileManager+Utils.swift in Sources */, + 3DB3A28A27DF308D00CE8F68 /* LoggerManager.swift in Sources */, D083ADBA27394D1100A8F96E /* DnsProtectionUserRulesMigrationHelper.swift in Sources */, B22FCDA8270B81C100B1C935 /* SharedResources.swift in Sources */, + 3DB3A28B27DF309B00CE8F68 /* LoggerManagerImpl.swift in Sources */, C73374372746D2FF00989447 /* Bundle+Utils.swift in Sources */, - B22FCDB5270B8D9700B1C935 /* ACLFileLogger.m in Sources */, + 3DB3A31127DF3CA800CE8F68 /* AGLoggerExtensions.swift in Sources */, D083ADC027394D3200A8F96E /* DnsStatisticsMigrationHelper.swift in Sources */, + 3DB3A28D27DF30C900CE8F68 /* ConsoleAppDestination.swift in Sources */, B22FCDA1270B7F2200B1C935 /* SharedResources+DebugLogs.swift in Sources */, B22FCDA5270B816100B1C935 /* SharedResources+applicationResources.swift in Sources */, B22FCDAC270B8AC800B1C935 /* AESharedResources.m in Sources */, + 3DB3A2F027DF387400CE8F68 /* LoggerManagerExtensions.swift in Sources */, B22FCDAF270B8C7400B1C935 /* ADLocales.m in Sources */, - B22FCDA2270B7FA200B1C935 /* CocoaLumberjack.swift in Sources */, - B22FCDB3270B8D7900B1C935 /* DDLoggerNames.m in Sources */, + 3DB3A2CB27DF33D600CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, B22FCDB4270B8D8B00B1C935 /* ACLFileLocker.m in Sources */, - B22FCDAD270B8C1300B1C935 /* ACLLogger.m in Sources */, B22FCDA3270B7FD000B1C935 /* Constants+Sentry.swift in Sources */, D083ADBE27394D2300A8F96E /* LowlevelSettingsMigrationHelper.swift in Sources */, + 3DB3A2C527DF33C800CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, D083ADB3273946C700A8F96E /* DnsMigration4_3.swift in Sources */, D083ADAC2732BC3500A8F96E /* MigrationStateManager.swift in Sources */, B22FCDA7270B819D00B1C935 /* Constants+LocalDnsAddresses.swift in Sources */, D083ADB927394D0500A8F96E /* DnsProtectionFiltersMigrationHelper.swift in Sources */, B22FCDA4270B814A00B1C935 /* SharedStorageUrls.swift in Sources */, + 3DB3A24E27DF2B7500CE8F68 /* LogLevel.swift in Sources */, B22FCDA6270B818200B1C935 /* LowLevelDnsConfiguration+Utils.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -9773,47 +9623,42 @@ D067D8E021428AA900ECDE6D /* ACIOUtils.m in Sources */, D067D8E321428AA900ECDE6D /* ADProductInfo.m in Sources */, D083AD7927301DC500A8F96E /* SharedResources.swift in Sources */, - D031A12D219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */, D07256ED26BD579100654177 /* Bundle+Utils.swift in Sources */, + 3DB3A2DF27DF370F00CE8F68 /* LogLevelExtensions.swift in Sources */, D067D8E521428AA900ECDE6D /* ACSSystemUtils.m in Sources */, - D031A0CB219EFC99002C17D9 /* DDTTYLogger.m in Sources */, 7EF5C51526C261BF001851D6 /* SharedResources+DebugLogs.swift in Sources */, D067D8E721428AA900ECDE6D /* NSString+Utils.m in Sources */, - D031A173219EFC99002C17D9 /* DDFileLogger.m in Sources */, D067D8E821428AA900ECDE6D /* ACLWildcard.m in Sources */, - D067D8E921428AA900ECDE6D /* ACLFileLogger.m in Sources */, D083AD7D27313FC100A8F96E /* ContentBlockerMigrationService.swift in Sources */, 7E9C0C2F256292DF00F1999D /* UIColor+Utils.swift in Sources */, D07256DC26BD556300654177 /* ContentBlockerRequestHandler.swift in Sources */, + 3DB3A25227DF2EB000CE8F68 /* LoggerManagerImpl.swift in Sources */, + 3DB3A26427DF2F7800CE8F68 /* ConsoleAppDestination.swift in Sources */, D067D8EA21428AA900ECDE6D /* ACLExecuteBlockDelayed.m in Sources */, D067D8EB21428AA900ECDE6D /* NSException+Utils.m in Sources */, D067D8EC21428AA900ECDE6D /* ACNNetworking.m in Sources */, D067D8ED21428AA900ECDE6D /* ACLFileLocker.m in Sources */, - D031A157219EFC99002C17D9 /* DDLoggerNames.m in Sources */, D067D8EE21428AA900ECDE6D /* ACFFileUtils.m in Sources */, D067D8F321428AA900ECDE6D /* ACIOStream.m in Sources */, - D031A11F219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */, - D031A0D9219EFC99002C17D9 /* DDOSLogger.m in Sources */, + 3DB3A29E27DF31AB00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, D067D8F421428AA900ECDE6D /* NSURL+Utils.m in Sources */, D067D8F521428AA900ECDE6D /* APCommonSharedResources.m in Sources */, D083AD8A273140A200A8F96E /* SDKMigrationOldFilesHelper.swift in Sources */, - D031A13B219EFC99002C17D9 /* DDMultiFormatter.m in Sources */, - D031A149219EFC99002C17D9 /* DDLog.m in Sources */, D083AD972731413500A8F96E /* SharedStorageUrls.swift in Sources */, D067D8F621428AA900ECDE6D /* ADLocations.m in Sources */, + 3DB3A25827DF2EB600CE8F68 /* LogLevel.swift in Sources */, D07D33FB26121F4D00213A5A /* Dictionary+Utils.swift in Sources */, D067D8F721428AA900ECDE6D /* NSDate+Utils.m in Sources */, - D067D8F821428AA900ECDE6D /* ACLLogger.m in Sources */, D067D8FB21428AA900ECDE6D /* AESharedResources.m in Sources */, D08CE433240D4BD100A70089 /* String+Utils.swift in Sources */, 24F5525A258753CB00AF1D3B /* DNSSettings.swift in Sources */, - D093719421B056B8004A24F1 /* CocoaLumberjack.swift in Sources */, D07D34D92612259A00213A5A /* CharacterSet+Utils.swift in Sources */, D083AD5E27301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, D067D8FC21428AA900ECDE6D /* ACNHttpUtils.m in Sources */, + 3DB3A29027DF315F00CE8F68 /* NativeLoggerWrapper.swift in Sources */, D08CE439240D4C5D00A70089 /* UIColorUtils.swift in Sources */, - D031A103219EFC99002C17D9 /* CLIColor.m in Sources */, - D031A165219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */, + 3DB3A2B527DF31E000CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, + 3DB3A25E27DF2EBF00CE8F68 /* LoggerManager.swift in Sources */, D067D8FD21428AA900ECDE6D /* ADLocales.m in Sources */, D067D8FE21428AA900ECDE6D /* Reachability.m in Sources */, 24441A122614CF28009555F3 /* String+NSRange.swift in Sources */, @@ -9824,50 +9669,45 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D031A12E219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */, D067D91121428B4600ECDE6D /* ACIOUtils.m in Sources */, D083AD7827301DC500A8F96E /* SharedResources.swift in Sources */, D067D91421428B4600ECDE6D /* ADProductInfo.m in Sources */, D07256EC26BD579000654177 /* Bundle+Utils.swift in Sources */, - D031A0CC219EFC99002C17D9 /* DDTTYLogger.m in Sources */, + 3DB3A2DE27DF370F00CE8F68 /* LogLevelExtensions.swift in Sources */, D067D91621428B4600ECDE6D /* ACSSystemUtils.m in Sources */, 7EF5C51626C261C0001851D6 /* SharedResources+DebugLogs.swift in Sources */, - D031A174219EFC99002C17D9 /* DDFileLogger.m in Sources */, D067D91921428B4600ECDE6D /* ACLWildcard.m in Sources */, 7E9C0C30256292DF00F1999D /* UIColor+Utils.swift in Sources */, - D067D91A21428B4600ECDE6D /* ACLFileLogger.m in Sources */, D083AD7E27313FC100A8F96E /* ContentBlockerMigrationService.swift in Sources */, D067D91B21428B4600ECDE6D /* ACLExecuteBlockDelayed.m in Sources */, D07256DD26BD556300654177 /* ContentBlockerRequestHandler.swift in Sources */, + 3DB3A25327DF2EB100CE8F68 /* LoggerManagerImpl.swift in Sources */, + 3DB3A26527DF2F7800CE8F68 /* ConsoleAppDestination.swift in Sources */, D067D91C21428B4600ECDE6D /* NSException+Utils.m in Sources */, D067D91D21428B4600ECDE6D /* ACNNetworking.m in Sources */, - D031A158219EFC99002C17D9 /* DDLoggerNames.m in Sources */, D067D91E21428B4600ECDE6D /* ACLFileLocker.m in Sources */, D067D91F21428B4600ECDE6D /* ACFFileUtils.m in Sources */, - D031A120219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */, - D031A0DA219EFC99002C17D9 /* DDOSLogger.m in Sources */, D067D92421428B4600ECDE6D /* ACIOStream.m in Sources */, + 3DB3A29F27DF31AB00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, D067D92521428B4600ECDE6D /* NSURL+Utils.m in Sources */, D067D92621428B4600ECDE6D /* APCommonSharedResources.m in Sources */, - D031A13C219EFC99002C17D9 /* DDMultiFormatter.m in Sources */, D083AD8B273140A200A8F96E /* SDKMigrationOldFilesHelper.swift in Sources */, - D031A14A219EFC99002C17D9 /* DDLog.m in Sources */, D067D92721428B4600ECDE6D /* ADLocations.m in Sources */, D083AD982731413500A8F96E /* SharedStorageUrls.swift in Sources */, D07D33F226121F4D00213A5A /* Dictionary+Utils.swift in Sources */, + 3DB3A25927DF2EB700CE8F68 /* LogLevel.swift in Sources */, D067D92821428B4600ECDE6D /* NSDate+Utils.m in Sources */, D0450F7D263C2A1100CA2110 /* NSString+Utils.m in Sources */, - D067D92921428B4600ECDE6D /* ACLLogger.m in Sources */, D067D92C21428B4600ECDE6D /* AESharedResources.m in Sources */, D08CE434240D4BD100A70089 /* String+Utils.swift in Sources */, 24F5525B258753CB00AF1D3B /* DNSSettings.swift in Sources */, - D093719521B056B9004A24F1 /* CocoaLumberjack.swift in Sources */, D07D34D82612259A00213A5A /* CharacterSet+Utils.swift in Sources */, D083AD5F27301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, D067D92D21428B4600ECDE6D /* ACNHttpUtils.m in Sources */, + 3DB3A29127DF316100CE8F68 /* NativeLoggerWrapper.swift in Sources */, D08CE43A240D4C5E00A70089 /* UIColorUtils.swift in Sources */, - D031A104219EFC99002C17D9 /* CLIColor.m in Sources */, - D031A166219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */, + 3DB3A2B727DF31E200CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, + 3DB3A25F27DF2EBF00CE8F68 /* LoggerManager.swift in Sources */, D067D92E21428B4600ECDE6D /* ADLocales.m in Sources */, D067D92F21428B4600ECDE6D /* Reachability.m in Sources */, 24441A132614CF28009555F3 /* String+NSRange.swift in Sources */, @@ -9878,50 +9718,45 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D031A12F219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */, D067D94221428B9100ECDE6D /* ACIOUtils.m in Sources */, D083AD7727301DC400A8F96E /* SharedResources.swift in Sources */, D067D94521428B9100ECDE6D /* ADProductInfo.m in Sources */, D07256EB26BD579000654177 /* Bundle+Utils.swift in Sources */, - D031A0CD219EFC99002C17D9 /* DDTTYLogger.m in Sources */, + 3DB3A2DD27DF370D00CE8F68 /* LogLevelExtensions.swift in Sources */, D067D94721428B9100ECDE6D /* ACSSystemUtils.m in Sources */, 7EF5C51826C261C9001851D6 /* SharedResources+DebugLogs.swift in Sources */, - D031A175219EFC99002C17D9 /* DDFileLogger.m in Sources */, D067D94A21428B9100ECDE6D /* ACLWildcard.m in Sources */, 7E9C0C31256292E000F1999D /* UIColor+Utils.swift in Sources */, - D067D94B21428B9100ECDE6D /* ACLFileLogger.m in Sources */, D083AD7F27313FC100A8F96E /* ContentBlockerMigrationService.swift in Sources */, D067D94C21428B9100ECDE6D /* ACLExecuteBlockDelayed.m in Sources */, D07256DE26BD556300654177 /* ContentBlockerRequestHandler.swift in Sources */, + 3DB3A25427DF2EB200CE8F68 /* LoggerManagerImpl.swift in Sources */, + 3DB3A26627DF2F7900CE8F68 /* ConsoleAppDestination.swift in Sources */, D067D94D21428B9100ECDE6D /* NSException+Utils.m in Sources */, D067D94E21428B9100ECDE6D /* ACNNetworking.m in Sources */, - D031A159219EFC99002C17D9 /* DDLoggerNames.m in Sources */, D067D94F21428B9100ECDE6D /* ACLFileLocker.m in Sources */, D067D95021428B9100ECDE6D /* ACFFileUtils.m in Sources */, - D031A121219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */, - D031A0DB219EFC99002C17D9 /* DDOSLogger.m in Sources */, D067D95521428B9100ECDE6D /* ACIOStream.m in Sources */, + 3DB3A2A027DF31AB00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, D067D95621428B9100ECDE6D /* NSURL+Utils.m in Sources */, D067D95721428B9100ECDE6D /* APCommonSharedResources.m in Sources */, - D031A13D219EFC99002C17D9 /* DDMultiFormatter.m in Sources */, D083AD8C273140A300A8F96E /* SDKMigrationOldFilesHelper.swift in Sources */, - D031A14B219EFC99002C17D9 /* DDLog.m in Sources */, D067D95821428B9100ECDE6D /* ADLocations.m in Sources */, D083AD992731413600A8F96E /* SharedStorageUrls.swift in Sources */, D07D33F326121F4D00213A5A /* Dictionary+Utils.swift in Sources */, + 3DB3A25A27DF2EB700CE8F68 /* LogLevel.swift in Sources */, D067D95921428B9100ECDE6D /* NSDate+Utils.m in Sources */, D0450F7E263C2A1200CA2110 /* NSString+Utils.m in Sources */, - D067D95A21428B9100ECDE6D /* ACLLogger.m in Sources */, D067D95D21428B9100ECDE6D /* AESharedResources.m in Sources */, D08CE435240D4BD200A70089 /* String+Utils.swift in Sources */, 24F5525C258753CC00AF1D3B /* DNSSettings.swift in Sources */, - D093719621B056B9004A24F1 /* CocoaLumberjack.swift in Sources */, D07D34D72612259900213A5A /* CharacterSet+Utils.swift in Sources */, D083AD6027301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, D067D95E21428B9100ECDE6D /* ACNHttpUtils.m in Sources */, + 3DB3A29227DF316100CE8F68 /* NativeLoggerWrapper.swift in Sources */, D08CE43B240D4C5E00A70089 /* UIColorUtils.swift in Sources */, - D031A105219EFC99002C17D9 /* CLIColor.m in Sources */, - D031A167219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */, + 3DB3A2B427DF31DF00CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, + 3DB3A26027DF2EC000CE8F68 /* LoggerManager.swift in Sources */, D067D95F21428B9100ECDE6D /* ADLocales.m in Sources */, D067D96021428B9100ECDE6D /* Reachability.m in Sources */, 24441A142614CF29009555F3 /* String+NSRange.swift in Sources */, @@ -9932,50 +9767,45 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D031A130219EFC99002C17D9 /* DDDispatchQueueLogFormatter.m in Sources */, D067D97321428BB500ECDE6D /* ACIOUtils.m in Sources */, D083AD7627301DC300A8F96E /* SharedResources.swift in Sources */, D067D97621428BB500ECDE6D /* ADProductInfo.m in Sources */, D07256EA26BD578F00654177 /* Bundle+Utils.swift in Sources */, - D031A0CE219EFC99002C17D9 /* DDTTYLogger.m in Sources */, + 3DB3A2DB27DF370C00CE8F68 /* LogLevelExtensions.swift in Sources */, D067D97821428BB500ECDE6D /* ACSSystemUtils.m in Sources */, 7EF5C51726C261C0001851D6 /* SharedResources+DebugLogs.swift in Sources */, - D031A176219EFC99002C17D9 /* DDFileLogger.m in Sources */, D067D97B21428BB500ECDE6D /* ACLWildcard.m in Sources */, 7E9C0C32256292E000F1999D /* UIColor+Utils.swift in Sources */, - D067D97C21428BB500ECDE6D /* ACLFileLogger.m in Sources */, D083AD8027313FC100A8F96E /* ContentBlockerMigrationService.swift in Sources */, D067D97D21428BB500ECDE6D /* ACLExecuteBlockDelayed.m in Sources */, D07256DF26BD556400654177 /* ContentBlockerRequestHandler.swift in Sources */, + 3DB3A25527DF2EB200CE8F68 /* LoggerManagerImpl.swift in Sources */, + 3DB3A26727DF2F7A00CE8F68 /* ConsoleAppDestination.swift in Sources */, D067D97E21428BB500ECDE6D /* NSException+Utils.m in Sources */, D067D97F21428BB500ECDE6D /* ACNNetworking.m in Sources */, - D031A15A219EFC99002C17D9 /* DDLoggerNames.m in Sources */, D067D98021428BB500ECDE6D /* ACLFileLocker.m in Sources */, D067D98121428BB500ECDE6D /* ACFFileUtils.m in Sources */, - D031A122219EFC99002C17D9 /* DDContextFilterLogFormatter.m in Sources */, - D031A0DC219EFC99002C17D9 /* DDOSLogger.m in Sources */, D067D98621428BB500ECDE6D /* ACIOStream.m in Sources */, + 3DB3A2A127DF31AC00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, D067D98721428BB500ECDE6D /* NSURL+Utils.m in Sources */, D067D98821428BB500ECDE6D /* APCommonSharedResources.m in Sources */, - D031A13E219EFC99002C17D9 /* DDMultiFormatter.m in Sources */, D083AD8D273140A300A8F96E /* SDKMigrationOldFilesHelper.swift in Sources */, - D031A14C219EFC99002C17D9 /* DDLog.m in Sources */, D067D98921428BB500ECDE6D /* ADLocations.m in Sources */, D083AD9A2731413800A8F96E /* SharedStorageUrls.swift in Sources */, D07D33F426121F4D00213A5A /* Dictionary+Utils.swift in Sources */, + 3DB3A25B27DF2EB800CE8F68 /* LogLevel.swift in Sources */, D067D98A21428BB500ECDE6D /* NSDate+Utils.m in Sources */, D0450F7F263C2A1300CA2110 /* NSString+Utils.m in Sources */, - D067D98B21428BB500ECDE6D /* ACLLogger.m in Sources */, D067D98E21428BB500ECDE6D /* AESharedResources.m in Sources */, D08CE436240D4BD200A70089 /* String+Utils.swift in Sources */, 24F5525D258753CD00AF1D3B /* DNSSettings.swift in Sources */, - D093719721B056BA004A24F1 /* CocoaLumberjack.swift in Sources */, D07D34D62612259900213A5A /* CharacterSet+Utils.swift in Sources */, D083AD6127301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, D067D98F21428BB500ECDE6D /* ACNHttpUtils.m in Sources */, + 3DB3A29327DF316200CE8F68 /* NativeLoggerWrapper.swift in Sources */, D08CE43C240D4C5F00A70089 /* UIColorUtils.swift in Sources */, - D031A106219EFC99002C17D9 /* CLIColor.m in Sources */, - D031A168219EFC99002C17D9 /* DDAbstractDatabaseLogger.m in Sources */, + 3DB3A2B327DF31DF00CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, + 3DB3A26127DF2EC100CE8F68 /* LoggerManager.swift in Sources */, D067D99021428BB500ECDE6D /* ADLocales.m in Sources */, D067D99121428BB500ECDE6D /* Reachability.m in Sources */, 24441A152614CF29009555F3 /* String+NSRange.swift in Sources */, @@ -9986,50 +9816,45 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D0B542992435C6A3002F0AEC /* DDDispatchQueueLogFormatter.m in Sources */, + 3DB3A27B27DF2FC500CE8F68 /* LogLevel.swift in Sources */, D0B5429A2435C6A3002F0AEC /* ACIOUtils.m in Sources */, D083AD7427301DC100A8F96E /* SharedResources.swift in Sources */, D07256EF26BD579200654177 /* Bundle+Utils.swift in Sources */, + 3DB3A2DA27DF370B00CE8F68 /* LogLevelExtensions.swift in Sources */, D0B5429B2435C6A3002F0AEC /* ADProductInfo.m in Sources */, - D0B5429D2435C6A3002F0AEC /* DDTTYLogger.m in Sources */, 7EF5C51D26C261CC001851D6 /* SharedResources+DebugLogs.swift in Sources */, D0B5429E2435C6A3002F0AEC /* ACSSystemUtils.m in Sources */, 7E9C0C37256292E300F1999D /* UIColor+Utils.swift in Sources */, - D0B542A02435C6A3002F0AEC /* DDFileLogger.m in Sources */, D0B542A12435C6A3002F0AEC /* ACLWildcard.m in Sources */, - D0B542A22435C6A3002F0AEC /* ACLFileLogger.m in Sources */, D083AD8327313FC100A8F96E /* ContentBlockerMigrationService.swift in Sources */, D07256E226BD556600654177 /* ContentBlockerRequestHandler.swift in Sources */, D0B542A32435C6A3002F0AEC /* ACLExecuteBlockDelayed.m in Sources */, D0B542A42435C6A3002F0AEC /* NSException+Utils.m in Sources */, D0B542A62435C6A3002F0AEC /* ACNNetworking.m in Sources */, - D0B542A72435C6A3002F0AEC /* DDLoggerNames.m in Sources */, D0B542A82435C6A3002F0AEC /* ACLFileLocker.m in Sources */, D0B542A92435C6A3002F0AEC /* ACFFileUtils.m in Sources */, - D0B542AA2435C6A3002F0AEC /* DDContextFilterLogFormatter.m in Sources */, - D0B542AD2435C6A3002F0AEC /* DDOSLogger.m in Sources */, D0B542AE2435C6A3002F0AEC /* ACIOStream.m in Sources */, D0B542AF2435C6A3002F0AEC /* NSURL+Utils.m in Sources */, + 3DB3A2A327DF31AE00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, D0B542B02435C6A3002F0AEC /* APCommonSharedResources.m in Sources */, - D0B542B12435C6A3002F0AEC /* DDMultiFormatter.m in Sources */, D083AD90273140A700A8F96E /* SDKMigrationOldFilesHelper.swift in Sources */, - D0B542B22435C6A3002F0AEC /* DDLog.m in Sources */, + 3DB3A26927DF2F7B00CE8F68 /* ConsoleAppDestination.swift in Sources */, D0B542B32435C6A3002F0AEC /* ADLocations.m in Sources */, D083AD9C2731413900A8F96E /* SharedStorageUrls.swift in Sources */, D07D33F726121F4D00213A5A /* Dictionary+Utils.swift in Sources */, D0450F85263C2A1800CA2110 /* NSString+Utils.m in Sources */, D0B542B52435C6A3002F0AEC /* NSDate+Utils.m in Sources */, - D0B542B62435C6A3002F0AEC /* ACLLogger.m in Sources */, D0B542B72435C6A3002F0AEC /* AESharedResources.m in Sources */, + 3DB3A26F27DF2F8200CE8F68 /* LoggerManagerImpl.swift in Sources */, 24F55260258753D200AF1D3B /* DNSSettings.swift in Sources */, D0B542B82435C6A3002F0AEC /* String+Utils.swift in Sources */, - D0B542B92435C6A3002F0AEC /* CocoaLumberjack.swift in Sources */, D07D34DB2612259D00213A5A /* CharacterSet+Utils.swift in Sources */, D083AD6627301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, D0B542BA2435C6A3002F0AEC /* ACNHttpUtils.m in Sources */, + 3DB3A29B27DF316C00CE8F68 /* NativeLoggerWrapper.swift in Sources */, D0B542BB2435C6A3002F0AEC /* UIColorUtils.swift in Sources */, - D0B542BC2435C6A3002F0AEC /* CLIColor.m in Sources */, - D0B542BD2435C6A3002F0AEC /* DDAbstractDatabaseLogger.m in Sources */, + 3DB3A2B027DF31D500CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, + 3DB3A27527DF2F8900CE8F68 /* LoggerManager.swift in Sources */, D0B542BE2435C6A3002F0AEC /* ADLocales.m in Sources */, D0B542BF2435C6A3002F0AEC /* Reachability.m in Sources */, 24441A182614CF2B009555F3 /* String+NSRange.swift in Sources */, @@ -10041,49 +9866,44 @@ buildActionMask = 2147483647; files = ( D0B542D02435C6A7002F0AEC /* ACIOUtils.m in Sources */, + 3DB3A27C27DF2FC600CE8F68 /* LogLevel.swift in Sources */, D0B542D12435C6A7002F0AEC /* ADProductInfo.m in Sources */, D083AD7327301DC000A8F96E /* SharedResources.swift in Sources */, D07256F026BD579300654177 /* Bundle+Utils.swift in Sources */, - D0B542D22435C6A7002F0AEC /* DDDispatchQueueLogFormatter.m in Sources */, + 3DB3A2D927DF370B00CE8F68 /* LogLevelExtensions.swift in Sources */, D0B542D52435C6A7002F0AEC /* ACSSystemUtils.m in Sources */, 7EF5C52026C261CD001851D6 /* SharedResources+DebugLogs.swift in Sources */, - D0B542D62435C6A7002F0AEC /* DDTTYLogger.m in Sources */, - D0B542D82435C6A7002F0AEC /* DDFileLogger.m in Sources */, 7E9C0C39256292E500F1999D /* UIColor+Utils.swift in Sources */, D0B542D92435C6A7002F0AEC /* ACLWildcard.m in Sources */, - D0B542DA2435C6A7002F0AEC /* ACLFileLogger.m in Sources */, D083AD8427313FC100A8F96E /* ContentBlockerMigrationService.swift in Sources */, D07256E326BD556700654177 /* ContentBlockerRequestHandler.swift in Sources */, D0B542DB2435C6A7002F0AEC /* ACLExecuteBlockDelayed.m in Sources */, D0B542DC2435C6A7002F0AEC /* NSException+Utils.m in Sources */, D0B542DD2435C6A7002F0AEC /* ACNNetworking.m in Sources */, D0B542DF2435C6A7002F0AEC /* ACLFileLocker.m in Sources */, - D0B542E02435C6A7002F0AEC /* DDLoggerNames.m in Sources */, D0B542E12435C6A7002F0AEC /* ACFFileUtils.m in Sources */, D0B542E22435C6A7002F0AEC /* ACIOStream.m in Sources */, - D0B542E32435C6A7002F0AEC /* DDContextFilterLogFormatter.m in Sources */, - D0B542E62435C6A7002F0AEC /* DDOSLogger.m in Sources */, D0B542E72435C6A7002F0AEC /* NSURL+Utils.m in Sources */, + 3DB3A2A427DF31AF00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, D0B542E82435C6A7002F0AEC /* APCommonSharedResources.m in Sources */, - D0B542EA2435C6A7002F0AEC /* DDMultiFormatter.m in Sources */, D083AD91273140A800A8F96E /* SDKMigrationOldFilesHelper.swift in Sources */, - D0B542EB2435C6A7002F0AEC /* DDLog.m in Sources */, + 3DB3A26A27DF2F7C00CE8F68 /* ConsoleAppDestination.swift in Sources */, D0B542EC2435C6A7002F0AEC /* ADLocations.m in Sources */, D083AD9D2731413A00A8F96E /* SharedStorageUrls.swift in Sources */, D07D33FA26121F4D00213A5A /* Dictionary+Utils.swift in Sources */, D0450F86263C2A1900CA2110 /* NSString+Utils.m in Sources */, D0B542EE2435C6A7002F0AEC /* NSDate+Utils.m in Sources */, - D0B542EF2435C6A7002F0AEC /* ACLLogger.m in Sources */, D0B542F02435C6A7002F0AEC /* AESharedResources.m in Sources */, + 3DB3A27027DF2F8300CE8F68 /* LoggerManagerImpl.swift in Sources */, 24F55261258753D200AF1D3B /* DNSSettings.swift in Sources */, D0B542F12435C6A7002F0AEC /* String+Utils.swift in Sources */, - D0B542F22435C6A7002F0AEC /* CocoaLumberjack.swift in Sources */, D07D34DC2612259F00213A5A /* CharacterSet+Utils.swift in Sources */, D083AD6727301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, D0B542F32435C6A7002F0AEC /* ACNHttpUtils.m in Sources */, + 3DB3A29A27DF316C00CE8F68 /* NativeLoggerWrapper.swift in Sources */, D0B542F42435C6A7002F0AEC /* UIColorUtils.swift in Sources */, - D0B542F52435C6A7002F0AEC /* CLIColor.m in Sources */, - D0B542F62435C6A7002F0AEC /* DDAbstractDatabaseLogger.m in Sources */, + 3DB3A2AF27DF31D400CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, + 3DB3A27627DF2F8A00CE8F68 /* LoggerManager.swift in Sources */, D0B542F72435C6A7002F0AEC /* ADLocales.m in Sources */, D0B542F82435C6A7002F0AEC /* Reachability.m in Sources */, 24441A192614CF2B009555F3 /* String+NSRange.swift in Sources */, @@ -10094,50 +9914,45 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D0B5430B2435C6AA002F0AEC /* DDDispatchQueueLogFormatter.m in Sources */, + 3DB3A27D27DF2FC600CE8F68 /* LogLevel.swift in Sources */, D0B5430C2435C6AA002F0AEC /* ACIOUtils.m in Sources */, D083AD7227301DBF00A8F96E /* SharedResources.swift in Sources */, D07256F126BD579400654177 /* Bundle+Utils.swift in Sources */, + 3DB3A2D827DF370A00CE8F68 /* LogLevelExtensions.swift in Sources */, D0B5430D2435C6AA002F0AEC /* ADProductInfo.m in Sources */, - D0B5430F2435C6AA002F0AEC /* DDTTYLogger.m in Sources */, 7EF5C51F26C261CD001851D6 /* SharedResources+DebugLogs.swift in Sources */, D0B543102435C6AA002F0AEC /* ACSSystemUtils.m in Sources */, 7E9C0C38256292E400F1999D /* UIColor+Utils.swift in Sources */, - D0B543122435C6AA002F0AEC /* DDFileLogger.m in Sources */, D0B543132435C6AA002F0AEC /* ACLWildcard.m in Sources */, - D0B543142435C6AA002F0AEC /* ACLFileLogger.m in Sources */, D083AD8527313FC100A8F96E /* ContentBlockerMigrationService.swift in Sources */, D07256E426BD556800654177 /* ContentBlockerRequestHandler.swift in Sources */, D0B543152435C6AA002F0AEC /* ACLExecuteBlockDelayed.m in Sources */, D0B543162435C6AA002F0AEC /* NSException+Utils.m in Sources */, D0B543182435C6AA002F0AEC /* ACNNetworking.m in Sources */, - D0B543192435C6AA002F0AEC /* DDLoggerNames.m in Sources */, D0B5431A2435C6AA002F0AEC /* ACLFileLocker.m in Sources */, D0B5431B2435C6AA002F0AEC /* ACFFileUtils.m in Sources */, - D0B5431C2435C6AA002F0AEC /* DDContextFilterLogFormatter.m in Sources */, - D0B5431F2435C6AA002F0AEC /* DDOSLogger.m in Sources */, D0B543202435C6AA002F0AEC /* ACIOStream.m in Sources */, D0B543212435C6AA002F0AEC /* NSURL+Utils.m in Sources */, + 3DB3A2A527DF31AF00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, D0B543222435C6AA002F0AEC /* APCommonSharedResources.m in Sources */, - D0B543232435C6AA002F0AEC /* DDMultiFormatter.m in Sources */, D083AD92273140A900A8F96E /* SDKMigrationOldFilesHelper.swift in Sources */, - D0B543242435C6AA002F0AEC /* DDLog.m in Sources */, + 3DB3A26B27DF2F7D00CE8F68 /* ConsoleAppDestination.swift in Sources */, D0B543252435C6AA002F0AEC /* ADLocations.m in Sources */, D083AD9E2731413B00A8F96E /* SharedStorageUrls.swift in Sources */, D07D33F826121F4D00213A5A /* Dictionary+Utils.swift in Sources */, D0450F87263C2A1900CA2110 /* NSString+Utils.m in Sources */, D0B543272435C6AA002F0AEC /* NSDate+Utils.m in Sources */, - D0B543282435C6AA002F0AEC /* ACLLogger.m in Sources */, D0B543292435C6AA002F0AEC /* AESharedResources.m in Sources */, + 3DB3A27127DF2F8300CE8F68 /* LoggerManagerImpl.swift in Sources */, 24F55262258753D300AF1D3B /* DNSSettings.swift in Sources */, D0B5432A2435C6AA002F0AEC /* String+Utils.swift in Sources */, - D0B5432B2435C6AA002F0AEC /* CocoaLumberjack.swift in Sources */, D07D34DD2612259F00213A5A /* CharacterSet+Utils.swift in Sources */, D083AD6827301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, D0B5432C2435C6AA002F0AEC /* ACNHttpUtils.m in Sources */, + 3DB3A29927DF316B00CE8F68 /* NativeLoggerWrapper.swift in Sources */, D0B5432D2435C6AA002F0AEC /* UIColorUtils.swift in Sources */, - D0B5432E2435C6AA002F0AEC /* CLIColor.m in Sources */, - D0B5432F2435C6AA002F0AEC /* DDAbstractDatabaseLogger.m in Sources */, + 3DB3A2B127DF31D500CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, + 3DB3A27727DF2F8A00CE8F68 /* LoggerManager.swift in Sources */, D0B543302435C6AA002F0AEC /* ADLocales.m in Sources */, D0B543312435C6AA002F0AEC /* Reachability.m in Sources */, 24441A1A2614CF2C009555F3 /* String+NSRange.swift in Sources */, @@ -10148,50 +9963,45 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D0B543442435C6AE002F0AEC /* DDDispatchQueueLogFormatter.m in Sources */, + 3DB3A27E27DF2FC700CE8F68 /* LogLevel.swift in Sources */, D0B543452435C6AE002F0AEC /* ACIOUtils.m in Sources */, D083AD7127301DBF00A8F96E /* SharedResources.swift in Sources */, D07256F226BD579400654177 /* Bundle+Utils.swift in Sources */, + 3DB3A2D727DF370A00CE8F68 /* LogLevelExtensions.swift in Sources */, D0B543462435C6AE002F0AEC /* ADProductInfo.m in Sources */, - D0B543482435C6AE002F0AEC /* DDTTYLogger.m in Sources */, 7EF5C52126C261CE001851D6 /* SharedResources+DebugLogs.swift in Sources */, D0B543492435C6AE002F0AEC /* ACSSystemUtils.m in Sources */, 7E9C0C3A256292E600F1999D /* UIColor+Utils.swift in Sources */, - D0B5434B2435C6AE002F0AEC /* DDFileLogger.m in Sources */, D0B5434C2435C6AE002F0AEC /* ACLWildcard.m in Sources */, - D0B5434D2435C6AE002F0AEC /* ACLFileLogger.m in Sources */, D083AD8627313FC100A8F96E /* ContentBlockerMigrationService.swift in Sources */, D07256E526BD556900654177 /* ContentBlockerRequestHandler.swift in Sources */, D0B5434E2435C6AE002F0AEC /* ACLExecuteBlockDelayed.m in Sources */, D0B5434F2435C6AE002F0AEC /* NSException+Utils.m in Sources */, D0B543512435C6AE002F0AEC /* ACNNetworking.m in Sources */, - D0B543522435C6AE002F0AEC /* DDLoggerNames.m in Sources */, D0B543532435C6AE002F0AEC /* ACLFileLocker.m in Sources */, D0B543542435C6AE002F0AEC /* ACFFileUtils.m in Sources */, - D0B543552435C6AE002F0AEC /* DDContextFilterLogFormatter.m in Sources */, - D0B543582435C6AE002F0AEC /* DDOSLogger.m in Sources */, D0B543592435C6AE002F0AEC /* ACIOStream.m in Sources */, D0B5435A2435C6AE002F0AEC /* NSURL+Utils.m in Sources */, + 3DB3A2A627DF31B000CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, D0B5435B2435C6AE002F0AEC /* APCommonSharedResources.m in Sources */, - D0B5435C2435C6AE002F0AEC /* DDMultiFormatter.m in Sources */, D083AD93273140A900A8F96E /* SDKMigrationOldFilesHelper.swift in Sources */, - D0B5435D2435C6AE002F0AEC /* DDLog.m in Sources */, + 3DB3A26C27DF2F7D00CE8F68 /* ConsoleAppDestination.swift in Sources */, D0B5435E2435C6AE002F0AEC /* ADLocations.m in Sources */, D083AD9F2731413B00A8F96E /* SharedStorageUrls.swift in Sources */, D07D33F126121F4D00213A5A /* Dictionary+Utils.swift in Sources */, D0450F88263C2A1A00CA2110 /* NSString+Utils.m in Sources */, D0B543602435C6AE002F0AEC /* NSDate+Utils.m in Sources */, - D0B543612435C6AE002F0AEC /* ACLLogger.m in Sources */, D0B543622435C6AE002F0AEC /* AESharedResources.m in Sources */, + 3DB3A27227DF2F8400CE8F68 /* LoggerManagerImpl.swift in Sources */, 24F55263258753D400AF1D3B /* DNSSettings.swift in Sources */, D0B543632435C6AE002F0AEC /* String+Utils.swift in Sources */, - D0B543642435C6AE002F0AEC /* CocoaLumberjack.swift in Sources */, D07D34DF261225A200213A5A /* CharacterSet+Utils.swift in Sources */, D083AD6927301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, D0B543652435C6AE002F0AEC /* ACNHttpUtils.m in Sources */, + 3DB3A29C27DF316D00CE8F68 /* NativeLoggerWrapper.swift in Sources */, D0B543662435C6AE002F0AEC /* UIColorUtils.swift in Sources */, - D0B543672435C6AE002F0AEC /* CLIColor.m in Sources */, - D0B543682435C6AE002F0AEC /* DDAbstractDatabaseLogger.m in Sources */, + 3DB3A2AE27DF31D300CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, + 3DB3A27827DF2F8B00CE8F68 /* LoggerManager.swift in Sources */, D0B543692435C6AE002F0AEC /* ADLocales.m in Sources */, D0B5436A2435C6AE002F0AEC /* Reachability.m in Sources */, 24441A2C2614CF2C009555F3 /* String+NSRange.swift in Sources */, @@ -10202,50 +10012,45 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D0B5437D2435C6B1002F0AEC /* DDDispatchQueueLogFormatter.m in Sources */, + 3DB3A27F27DF2FC800CE8F68 /* LogLevel.swift in Sources */, D0B5437E2435C6B1002F0AEC /* ACIOUtils.m in Sources */, D083AD7027301DBE00A8F96E /* SharedResources.swift in Sources */, D07256F326BD579500654177 /* Bundle+Utils.swift in Sources */, + 3DB3A2D627DF370900CE8F68 /* LogLevelExtensions.swift in Sources */, D0B5437F2435C6B1002F0AEC /* ADProductInfo.m in Sources */, - D0B543812435C6B1002F0AEC /* DDTTYLogger.m in Sources */, D0B543822435C6B1002F0AEC /* ACSSystemUtils.m in Sources */, 7E9C0C3B256292E600F1999D /* UIColor+Utils.swift in Sources */, - D0B543842435C6B1002F0AEC /* DDFileLogger.m in Sources */, 7EF5C54E26C26223001851D6 /* SharedResources+DebugLogs.swift in Sources */, D0B543852435C6B1002F0AEC /* ACLWildcard.m in Sources */, - D0B543862435C6B1002F0AEC /* ACLFileLogger.m in Sources */, D083AD8727313FC100A8F96E /* ContentBlockerMigrationService.swift in Sources */, D07256E626BD556900654177 /* ContentBlockerRequestHandler.swift in Sources */, D0B543872435C6B1002F0AEC /* ACLExecuteBlockDelayed.m in Sources */, D0B543882435C6B1002F0AEC /* NSException+Utils.m in Sources */, D0B5438A2435C6B1002F0AEC /* ACNNetworking.m in Sources */, - D0B5438B2435C6B1002F0AEC /* DDLoggerNames.m in Sources */, D0B5438C2435C6B1002F0AEC /* ACLFileLocker.m in Sources */, D0B5438D2435C6B1002F0AEC /* ACFFileUtils.m in Sources */, - D0B5438E2435C6B1002F0AEC /* DDContextFilterLogFormatter.m in Sources */, - D0B543912435C6B1002F0AEC /* DDOSLogger.m in Sources */, D0B543922435C6B1002F0AEC /* ACIOStream.m in Sources */, D0B543932435C6B1002F0AEC /* NSURL+Utils.m in Sources */, + 3DB3A2A927DF31B200CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, D0B543942435C6B1002F0AEC /* APCommonSharedResources.m in Sources */, - D0B543952435C6B1002F0AEC /* DDMultiFormatter.m in Sources */, D083AD94273140AA00A8F96E /* SDKMigrationOldFilesHelper.swift in Sources */, - D0B543962435C6B1002F0AEC /* DDLog.m in Sources */, + 3DB3A26D27DF2F7E00CE8F68 /* ConsoleAppDestination.swift in Sources */, D0B543972435C6B1002F0AEC /* ADLocations.m in Sources */, D083ADA02731413C00A8F96E /* SharedStorageUrls.swift in Sources */, D07D33FC26121F4D00213A5A /* Dictionary+Utils.swift in Sources */, D0450F89263C2A1A00CA2110 /* NSString+Utils.m in Sources */, D0B543992435C6B1002F0AEC /* NSDate+Utils.m in Sources */, - D0B5439A2435C6B1002F0AEC /* ACLLogger.m in Sources */, D0B5439B2435C6B1002F0AEC /* AESharedResources.m in Sources */, + 3DB3A27327DF2F8400CE8F68 /* LoggerManagerImpl.swift in Sources */, 24F55264258753D400AF1D3B /* DNSSettings.swift in Sources */, D0B5439C2435C6B1002F0AEC /* String+Utils.swift in Sources */, - D0B5439D2435C6B1002F0AEC /* CocoaLumberjack.swift in Sources */, D07D34E0261225A300213A5A /* CharacterSet+Utils.swift in Sources */, D083AD6A27301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, D0B5439E2435C6B1002F0AEC /* ACNHttpUtils.m in Sources */, + 3DB3A29827DF316B00CE8F68 /* NativeLoggerWrapper.swift in Sources */, D0B5439F2435C6B1002F0AEC /* UIColorUtils.swift in Sources */, - D0B543A02435C6B1002F0AEC /* CLIColor.m in Sources */, - D0B543A12435C6B1002F0AEC /* DDAbstractDatabaseLogger.m in Sources */, + 3DB3A2AD27DF31D300CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, + 3DB3A27927DF2F8B00CE8F68 /* LoggerManager.swift in Sources */, D0B543A22435C6B1002F0AEC /* ADLocales.m in Sources */, D0B543A32435C6B1002F0AEC /* Reachability.m in Sources */, 24441A2D2614CF2D009555F3 /* String+NSRange.swift in Sources */, @@ -10256,50 +10061,45 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D0B543B62435C6B5002F0AEC /* DDDispatchQueueLogFormatter.m in Sources */, + 3DB3A28027DF2FC900CE8F68 /* LogLevel.swift in Sources */, D0B543B72435C6B5002F0AEC /* ACIOUtils.m in Sources */, D083AD6F27301DBE00A8F96E /* SharedResources.swift in Sources */, D07256F426BD579500654177 /* Bundle+Utils.swift in Sources */, + 3DB3A2D527DF370900CE8F68 /* LogLevelExtensions.swift in Sources */, D0B543B82435C6B5002F0AEC /* ADProductInfo.m in Sources */, - D0B543BA2435C6B5002F0AEC /* DDTTYLogger.m in Sources */, 7EF5C52426C261D0001851D6 /* SharedResources+DebugLogs.swift in Sources */, D0B543BB2435C6B5002F0AEC /* ACSSystemUtils.m in Sources */, 7E9C0C3C256292E700F1999D /* UIColor+Utils.swift in Sources */, - D0B543BD2435C6B5002F0AEC /* DDFileLogger.m in Sources */, D0B543BE2435C6B5002F0AEC /* ACLWildcard.m in Sources */, - D0B543BF2435C6B5002F0AEC /* ACLFileLogger.m in Sources */, D083AD8827313FC100A8F96E /* ContentBlockerMigrationService.swift in Sources */, D07256E726BD556A00654177 /* ContentBlockerRequestHandler.swift in Sources */, D0B543C02435C6B5002F0AEC /* ACLExecuteBlockDelayed.m in Sources */, D0B543C12435C6B5002F0AEC /* NSException+Utils.m in Sources */, D0B543C32435C6B5002F0AEC /* ACNNetworking.m in Sources */, - D0B543C42435C6B5002F0AEC /* DDLoggerNames.m in Sources */, D0B543C52435C6B5002F0AEC /* ACLFileLocker.m in Sources */, D0B543C62435C6B5002F0AEC /* ACFFileUtils.m in Sources */, - D0B543C72435C6B5002F0AEC /* DDContextFilterLogFormatter.m in Sources */, - D0B543CA2435C6B5002F0AEC /* DDOSLogger.m in Sources */, D0B543CB2435C6B5002F0AEC /* ACIOStream.m in Sources */, D0B543CC2435C6B5002F0AEC /* NSURL+Utils.m in Sources */, + 3DB3A2A827DF31B100CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, D0B543CD2435C6B5002F0AEC /* APCommonSharedResources.m in Sources */, - D0B543CE2435C6B5002F0AEC /* DDMultiFormatter.m in Sources */, D083AD95273140AA00A8F96E /* SDKMigrationOldFilesHelper.swift in Sources */, - D0B543CF2435C6B5002F0AEC /* DDLog.m in Sources */, + 3DB3A26E27DF2F7F00CE8F68 /* ConsoleAppDestination.swift in Sources */, D0B543D02435C6B5002F0AEC /* ADLocations.m in Sources */, D083ADA12731413C00A8F96E /* SharedStorageUrls.swift in Sources */, D07D33F926121F4D00213A5A /* Dictionary+Utils.swift in Sources */, D0450F8A263C2A1B00CA2110 /* NSString+Utils.m in Sources */, D0B543D22435C6B5002F0AEC /* NSDate+Utils.m in Sources */, - D0B543D32435C6B5002F0AEC /* ACLLogger.m in Sources */, D0B543D42435C6B5002F0AEC /* AESharedResources.m in Sources */, + 3DB3A27427DF2F8500CE8F68 /* LoggerManagerImpl.swift in Sources */, 24F55265258753D500AF1D3B /* DNSSettings.swift in Sources */, D0B543D52435C6B5002F0AEC /* String+Utils.swift in Sources */, - D0B543D62435C6B5002F0AEC /* CocoaLumberjack.swift in Sources */, D07D34DE261225A000213A5A /* CharacterSet+Utils.swift in Sources */, D083AD6B27301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, D0B543D72435C6B5002F0AEC /* ACNHttpUtils.m in Sources */, + 3DB3A29727DF316A00CE8F68 /* NativeLoggerWrapper.swift in Sources */, D0B543D82435C6B5002F0AEC /* UIColorUtils.swift in Sources */, - D0B543D92435C6B5002F0AEC /* CLIColor.m in Sources */, - D0B543DA2435C6B5002F0AEC /* DDAbstractDatabaseLogger.m in Sources */, + 3DB3A2AC27DF31D200CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, + 3DB3A27A27DF2F8C00CE8F68 /* LoggerManager.swift in Sources */, D0B543DB2435C6B5002F0AEC /* ADLocales.m in Sources */, D0B543DC2435C6B5002F0AEC /* Reachability.m in Sources */, 24441A2E2614CF2D009555F3 /* String+NSRange.swift in Sources */, @@ -10312,19 +10112,15 @@ files = ( 2408A8CC2747F44A00D2D1DE /* RequestFactory.swift in Sources */, B2673DF3271750B300E04747 /* ThemeMode.swift in Sources */, - B2673E0E2717514900E04747 /* CocoaLumberjack.swift in Sources */, B2673DFE271750E400E04747 /* SharedResources+applicationResources.swift in Sources */, 2408A8BE2747F3C500D2D1DE /* AdClientWrapper.swift in Sources */, B2673DEF2717506D00E04747 /* SharedStorageUrls.swift in Sources */, - B2673DF6271750C100E04747 /* DDLoggerNames.m in Sources */, - B2673E0C2717512E00E04747 /* ACLFileLogger.m in Sources */, B2673E0D2717514500E04747 /* String+Utils.swift in Sources */, 7E174BFD271F1523006B7271 /* KeychainService.swift in Sources */, - B2673DFD271750E100E04747 /* DDOSLogger.m in Sources */, 2408A8C12747F3E300D2D1DE /* RequestSenderProtocol.swift in Sources */, D0A23548271ED4B100CE1730 /* DnsProvidersManagerProtocol+ServerName.swift in Sources */, B2673E072717510700E04747 /* DispatchQueue+Utils.swift in Sources */, - B2673DF8271750C700E04747 /* DDFileLogger.m in Sources */, + 3D1EA72A27DA3596005E7153 /* LoggerManagerImpl.swift in Sources */, 2408A8C92747F43500D2D1DE /* HttpRequestServiceProtocol+sendFeedback.swift in Sources */, 2408A8C52747F40800D2D1DE /* ParserProtocol.swift in Sources */, B2673E8027176D1300E04747 /* VpnConfigurationStatus.swift in Sources */, @@ -10332,10 +10128,10 @@ B2673DF5271750BC00E04747 /* ADLocales.m in Sources */, B2673DFB271750D500E04747 /* NotificationCenter+Utils.swift in Sources */, B2673DF12717508500E04747 /* ComplexProtectionService.swift in Sources */, - B2673DFA271750D200E04747 /* ACLLogger.m in Sources */, 7E6AD3A1271F15FC00BCEA7F /* Reachability.m in Sources */, B2673E162717516D00E04747 /* ConfigurationService.swift in Sources */, 7E6AD39C271F15C700BCEA7F /* PurchaseServiceProtocol.swift in Sources */, + 3D1EA72C27DA35BB005E7153 /* ConsoleAppDestination.swift in Sources */, B2673E02271750F300E04747 /* DnsConfiguration+Initializers.swift in Sources */, 2408A8B92747F3A300D2D1DE /* AdServicesWrapper.swift in Sources */, 2408A8B72747F39A00D2D1DE /* AdServicesHelper.swift in Sources */, @@ -10345,19 +10141,22 @@ B2673DED2717506300E04747 /* ServiceInitializer.swift in Sources */, B2673DF9271750CB00E04747 /* NSString+Utils.m in Sources */, B2673DFC271750DC00E04747 /* SharedResources.swift in Sources */, - B2673E102717515500E04747 /* DDLog.m in Sources */, + 3DB3A2FF27DF392C00CE8F68 /* LoggerManager.swift in Sources */, B2673DF02717508000E04747 /* PurchaseAssistant.swift in Sources */, B2673E03271750F700E04747 /* ADProductInfo.m in Sources */, + 3D1EA71C27DA2D37005E7153 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, 7E6AD39B271F15A600BCEA7F /* LoginResponseParser.swift in Sources */, B2673E0B2717512B00E04747 /* ConfigurationServiceProtocol.swift in Sources */, D083AD6C27301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, 2408A8CA2747F44500D2D1DE /* SupportService+Feedback.swift in Sources */, + 3D1EA6EA27DA034F005E7153 /* LogLevel.swift in Sources */, 2408A8D52747F48A00D2D1DE /* AdServicesAttributionRecordsRequest.swift in Sources */, B2673E04271750FA00E04747 /* SharedResources+DebugLogs.swift in Sources */, B2673DEA2717505400E04747 /* TodayViewController.swift in Sources */, 2408A8B52747F39300D2D1DE /* AppleSearchAdsService.swift in Sources */, B2673DEE2717506900E04747 /* LowLevelDnsConfiguration+Utils.swift in Sources */, B2673E0F2717514D00E04747 /* ACNNetworking.m in Sources */, + 3D1EA71A27DA2CED005E7153 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, B2673E152717516900E04747 /* NativeDnsSettingsManager.swift in Sources */, B2673E05271750FE00E04747 /* NetworkSettingsService.swift in Sources */, 2408A8D12747F46D00D2D1DE /* AdServicesAttributionRecordsParser.swift in Sources */, @@ -10374,12 +10173,13 @@ B2673DF2271750AF00E04747 /* AESharedResources.m in Sources */, 2408A8CF2747F46700D2D1DE /* SuccessFailureParser.swift in Sources */, 2408A8BF2747F3D600D2D1DE /* HttpRequestService.swift in Sources */, - B2673DEB2717505800E04747 /* DDTTYLogger.m in Sources */, 7E6AD39F271F15E400BCEA7F /* ABECRequest.m in Sources */, B2673E062717510400E04747 /* Bundle+Utils.swift in Sources */, 2408A8BC2747F3BC00D2D1DE /* IAdFrameworkHelper.swift in Sources */, B2673E092717510E00E04747 /* APCommonSharedResources.m in Sources */, + 3D1EA72827DA353E005E7153 /* LogLevelExtensions.swift in Sources */, 7E174BFE271F1532006B7271 /* LoginService.swift in Sources */, + 3D1EA71827DA2CD0005E7153 /* NativeLoggerWrapper.swift in Sources */, B2673E0A2717512300E04747 /* String+NSRange.swift in Sources */, B2673E112717515900E04747 /* ACLFileLocker.m in Sources */, ); @@ -10392,13 +10192,16 @@ B2673E51271753D300E04747 /* ADProductInfo.m in Sources */, B2673E422717535D00E04747 /* PreloadedFilesManager.swift in Sources */, B2673E27271752B200E04747 /* PurchaseStatusProtocol.swift in Sources */, + 3DB3A30927DF396A00CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, B2673E3C2717534900E04747 /* PurchaseAssistant.swift in Sources */, B2673E182717524B00E04747 /* URL+CustomSchemeURLParserProtocol.swift in Sources */, + 3DB3A2FE27DF392B00CE8F68 /* LoggerManager.swift in Sources */, B2673E642717542F00E04747 /* ThemeService.swift in Sources */, B2673E382717533C00E04747 /* ParserProtocol.swift in Sources */, B2673E5D2717541700E04747 /* Bundle+Utils.swift in Sources */, B2673E442717536A00E04747 /* WebReporterSafariFiltersWrapper.swift in Sources */, B2673E29271752B900E04747 /* ActionExtensionWebReporter.swift in Sources */, + 3DB3A30427DF396100CE8F68 /* LoggerManagerImpl.swift in Sources */, B2673E472717537600E04747 /* DispatchQueue+Utils.swift in Sources */, B2673E4B2717539600E04747 /* ACLExecuteBlockDelayed.m in Sources */, B2673E24271752A700E04747 /* UIDevice+Utils.swift in Sources */, @@ -10408,25 +10211,22 @@ 2408A8CD2747F44A00D2D1DE /* RequestFactory.swift in Sources */, 2408A8CE2747F46700D2D1DE /* SuccessFailureParser.swift in Sources */, B2673E342717532900E04747 /* String+NSRange.swift in Sources */, + 3DB3A30327DF393500CE8F68 /* LogLevelExtensions.swift in Sources */, B2673E682717543C00E04747 /* NSURL+Utils.m in Sources */, B2673E53271753F100E04747 /* NSDate+Utils.m in Sources */, B2673E622717542700E04747 /* ConfigurationServiceProtocol.swift in Sources */, 2408A8B82747F39B00D2D1DE /* AdServicesHelper.swift in Sources */, B2673E482717538A00E04747 /* UIColorUtils.swift in Sources */, - B2673E692717543F00E04747 /* ACLLogFileManagerDefault.swift in Sources */, B2673E172717523E00E04747 /* ThemeMode.swift in Sources */, B2673E372717533800E04747 /* AESharedResources.m in Sources */, B2673E25271752AB00E04747 /* Array+Utils.swift in Sources */, B2673E4C2717539B00E04747 /* ServicesInitializer.swift in Sources */, - B2673E392717533F00E04747 /* DDMultiFormatter.m in Sources */, + 3DB3A30D27DF397600CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, B2673E662717543600E04747 /* ACSSystemUtils.m in Sources */, B2673E3E2717534E00E04747 /* ActionExtensionUserRulesHelper.swift in Sources */, D0611F1427396F8D00124BC4 /* ObsoleteSafariAllowlistRulesWrappers.swift in Sources */, B2673E5B2717541000E04747 /* LoginResponseParser.swift in Sources */, D0611F1027396E3B00124BC4 /* SafariProtectionAllowlistRulesMigrationHelper.swift in Sources */, - B2673E4A2717539100E04747 /* CocoaLumberjack.swift in Sources */, - B2673E632717542A00E04747 /* DDLoggerNames.m in Sources */, - B2673E2D271752C700E04747 /* DDAbstractDatabaseLogger.m in Sources */, B2673E50271753D000E04747 /* ContextProvider.swift in Sources */, 2483F7E8277B041600BE0A13 /* DnsMigration4_3_1.swift in Sources */, B2673E6A2717544100E04747 /* NotificationCenter+Utils.swift in Sources */, @@ -10435,17 +10235,15 @@ B2673E332717532500E04747 /* FavIconService.swift in Sources */, B2673E612717542400E04747 /* UIViewController+Alert.swift in Sources */, D083ADAF2732BC3500A8F96E /* MigrationStateManager.swift in Sources */, + 3DB3A30F27DF39F200CE8F68 /* NativeLoggerWrapper.swift in Sources */, 2408A8D42747F48900D2D1DE /* AdServicesAttributionRecordsRequest.swift in Sources */, B2673E672717543900E04747 /* ADLocations.m in Sources */, B2673E23271752A300E04747 /* ACIOUtils.m in Sources */, - B2673E3D2717534B00E04747 /* DDOSLogger.m in Sources */, B2673E2E271752CA00E04747 /* ThemableImageView.swift in Sources */, B2673E1C2717525A00E04747 /* PurchaseServiceProtocol.swift in Sources */, - B2673E6B2717544400E04747 /* CLIColor.m in Sources */, 2408A8C22747F3E400D2D1DE /* RequestSenderProtocol.swift in Sources */, 2408A8D22747F47D00D2D1DE /* SendFeedbackRequest.swift in Sources */, B2673E602717542100E04747 /* String+Utils.swift in Sources */, - B2673E432717536100E04747 /* DDTTYLogger.m in Sources */, B2673E5A2717540D00E04747 /* ThemableButton.swift in Sources */, B2673E5E2717541A00E04747 /* SharedStorageUrls.swift in Sources */, B2673E2C271752C300E04747 /* NSStringPunycodeAdditions.m in Sources */, @@ -10458,16 +10256,16 @@ B2673E652717543200E04747 /* ThemableLabel.swift in Sources */, B2673E52271753DB00E04747 /* LowLevelDnsConfiguration+Utils.swift in Sources */, B2673E592717540A00E04747 /* ACNNetworking.m in Sources */, - B2673E3A2717534300E04747 /* DDContextFilterLogFormatter.m in Sources */, B2673E202717526900E04747 /* FileManager+Utils.swift in Sources */, B2673E2A271752BC00E04747 /* ActionExtensionLoaderViewController.swift in Sources */, + 3DB3A30127DF393000CE8F68 /* LogLevel.swift in Sources */, C7DD464E2754E19B006E1E6C /* UITraitCollection+Utils.swift in Sources */, B2673E31271752D400E04747 /* UIColor+Utils.swift in Sources */, B2673E54271753F400E04747 /* DNSSettings.swift in Sources */, 2408A8C62747F41C00D2D1DE /* RequestProtocol.swift in Sources */, 2408A8BA2747F3A400D2D1DE /* AdServicesWrapper.swift in Sources */, B2673E222717529F00E04747 /* LoginService.swift in Sources */, - B2673E362717533400E04747 /* ACLLogger.m in Sources */, + 3DB3A30727DF396700CE8F68 /* ConsoleAppDestination.swift in Sources */, B2673E452717536E00E04747 /* SharedResources+Theme.swift in Sources */, B2673E582717540400E04747 /* SafariConfiguration+Initializers.swift in Sources */, 2408A8C82747F43300D2D1DE /* HttpRequestServiceProtocol+sendFeedback.swift in Sources */, @@ -10478,14 +10276,10 @@ B2673E4D2717539F00E04747 /* WebReporterProtocol.swift in Sources */, 2408A8D02747F46D00D2D1DE /* AdServicesAttributionRecordsParser.swift in Sources */, B2673E1B2717525600E04747 /* PurchaseService.swift in Sources */, - B2673E26271752AF00E04747 /* DDLog.m in Sources */, B2673E5F2717541E00E04747 /* URL+Utils.swift in Sources */, 2408A8BB2747F3BB00D2D1DE /* IAdFrameworkHelper.swift in Sources */, D0611F0C27396C7400124BC4 /* SafariMigration4_3.swift in Sources */, B2673E2F271752CD00E04747 /* ACLFileLocker.m in Sources */, - B2673E1A2717525300E04747 /* DDDispatchQueueLogFormatter.m in Sources */, - B2673E5C2717541400E04747 /* DDFileLogger.m in Sources */, - B2673E352717532C00E04747 /* ACLFileLogger.m in Sources */, B2673E1E2717526100E04747 /* ActionExtensionTableController.swift in Sources */, B2673E322717532100E04747 /* KeychainService.swift in Sources */, D083AD6D27301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, @@ -10508,35 +10302,37 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 3D1EA71027DA2C06005E7153 /* NativeLoggerWrapper.swift in Sources */, + 3DB3A2D327DF370700CE8F68 /* LogLevelExtensions.swift in Sources */, B2673E7E271754B400E04747 /* SharedStorageUrls.swift in Sources */, - B2673E732717549300E04747 /* ACLFileLogger.m in Sources */, - B2673E78271754A300E04747 /* CocoaLumberjack.swift in Sources */, D083ADBD27394D1C00A8F96E /* DnsProtectionCustomProvidersMigrationHelper.swift in Sources */, B2673E7F271754B700E04747 /* LowLevelDnsConfiguration+Utils.swift in Sources */, D083AD6E27301CAB00A8F96E /* MigrationServiceVersionProvider.swift in Sources */, - B2673E79271754A600E04747 /* DDLoggerNames.m in Sources */, D083ADC227394DBD00A8F96E /* FileManager+Utils.swift in Sources */, + 3DB3A28927DF308B00CE8F68 /* LoggerManager.swift in Sources */, D083ADBB27394D1200A8F96E /* DnsProtectionUserRulesMigrationHelper.swift in Sources */, B2673E6E2717548100E04747 /* TunnelProvider.swift in Sources */, + 3DB3A28C27DF309C00CE8F68 /* LoggerManagerImpl.swift in Sources */, C73374382746D30000989447 /* Bundle+Utils.swift in Sources */, - B2673E712717548B00E04747 /* DDTTYLogger.m in Sources */, + 3DB3A32627DF3CB500CE8F68 /* AGLoggerExtensions.swift in Sources */, D083ADC127394D3300A8F96E /* DnsStatisticsMigrationHelper.swift in Sources */, + 3DB3A28E27DF30CB00CE8F68 /* ConsoleAppDestination.swift in Sources */, B2673E742717549600E04747 /* SharedResources+DebugLogs.swift in Sources */, B2673E7A271754A900E04747 /* ACLFileLocker.m in Sources */, B2673E762717549C00E04747 /* AESharedResources.m in Sources */, - B2673E702717548800E04747 /* DDOSLogger.m in Sources */, - B2673E6F2717548400E04747 /* DDFileLogger.m in Sources */, - B2673E7B271754AC00E04747 /* ACLLogger.m in Sources */, + 3DB3A2C827DF33CE00CE8F68 /* NativeLoggerWrapperSystemLoggerImpl.swift in Sources */, B2673E7D271754B100E04747 /* Constants+LocalDnsAddresses.swift in Sources */, B2673E722717548F00E04747 /* SharedResources.swift in Sources */, - B2673E6D2717547D00E04747 /* DDLog.m in Sources */, D083ADBF27394D2500A8F96E /* LowlevelSettingsMigrationHelper.swift in Sources */, + 3DB3A2C427DF33C700CE8F68 /* NativeLoggerWrapperOsLogImpl.swift in Sources */, D083ADB7273946C700A8F96E /* DnsMigration4_3.swift in Sources */, D083ADB02732BC3500A8F96E /* MigrationStateManager.swift in Sources */, B2673E752717549900E04747 /* SharedResources+applicationResources.swift in Sources */, D083ADB827394D0200A8F96E /* DnsProtectionFiltersMigrationHelper.swift in Sources */, B2673E7C271754AE00E04747 /* Constants+Sentry.swift in Sources */, + 3DB3A24D27DF2B7400CE8F68 /* LogLevel.swift in Sources */, B2673E772717549F00E04747 /* ADLocales.m in Sources */, + 3DF1EB9527DFB592002D7B56 /* LoggerManagerExtensions.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/AdguardExtension/AdguardApp/ACObject.h b/AdguardExtension/AdguardApp/ACObject.h index fff4cd5bb..7d9875a83 100644 --- a/AdguardExtension/AdguardApp/ACObject.h +++ b/AdguardExtension/AdguardApp/ACObject.h @@ -16,6 +16,8 @@ // along with Adguard for iOS. If not, see . // +// TODO: This Objective-C class never USED, remove it + #import ///////////////////////////////////////////////////////////////////// diff --git a/AdguardExtension/AdguardApp/ACObject.m b/AdguardExtension/AdguardApp/ACObject.m index 6d5034709..34c98ba14 100644 --- a/AdguardExtension/AdguardApp/ACObject.m +++ b/AdguardExtension/AdguardApp/ACObject.m @@ -16,12 +16,15 @@ // along with Adguard for iOS. If not, see . // +// TODO: This Objective-C class never USED, remove it + #import #import "NSString+Utils.h" #import "ACObject.h" -#import "DDLogMacros.h" #import "ACommons/ACLang.h" #import "ACommons/ACIO.h" +#import "ObjCLogMacro.h" +#import ///////////////////////////////////////////////////////////////////// @@ -37,8 +40,14 @@ @implementation ACObject #pragma mark Init and Class methods ///////////////////////////////////////////////////////////////////// +static LoggerWrapper *LOG = nil; + +(void)initialize{ + if (!LOG) { + LOG = [LoggerFactory objcGetLoggerWrapper: ACObject.self]; + } + @autoreleasepool { if (!workingQueue) { @@ -127,7 +136,7 @@ - (id)initWithCoder:(NSCoder *)aDecoder{ if (obj) propertiesDict[key] = obj; } @catch (NSException *exception) { - DDLogError(@"An error occurred, while decoding object (initWithCoder initializer, ACObject class), exception : %@", exception); + ObjcLogError(LOG, @"An error occurred, while decoding object (initWithCoder initializer, ACObject class), exception : %@", exception); } } diff --git a/AdguardExtension/AdguardApp/AppDelegate/AppDelegate.swift b/AdguardExtension/AdguardApp/AppDelegate/AppDelegate.swift index 822c109f2..0e4d2206b 100644 --- a/AdguardExtension/AdguardApp/AppDelegate/AppDelegate.swift +++ b/AdguardExtension/AdguardApp/AppDelegate/AppDelegate.swift @@ -23,6 +23,8 @@ import AGDnsProxy import Sentry import UIKit +private let LOG = LoggerFactory.getLoggerWrapper(AppDelegate.self) + @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { @@ -72,15 +74,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate { override init() { let resources = StartupService.initResources() - AppDelegate.initLogger(resources: resources) - DDLogInfo("Starting application") - // StartupService may perform slow operations involving working with files or SQLite database. // It is safer to try to protect it from suspending by using a background task. _ = UIBackgroundTask.execute(name: "AppDelegate.init") { StartupService.start() } + LOG.info("Starting application") + self.resources = ServiceLocator.shared.getService()! self.safariProtection = ServiceLocator.shared.getService()! self.purchaseService = ServiceLocator.shared.getService()! @@ -99,7 +100,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { super.init() - DDLogInfo("Application has been started. Version: \(productInfo.buildVersion() ?? "nil")") + LOG.info("Application has been started. Version: \(productInfo.buildVersion() ?? "nil")") } deinit { @@ -107,7 +108,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { - DDLogInfo("(AppDelegate) willFinishLaunchingWithOptions called in background=\(application.applicationState == .background)") + LOG.info("willFinishLaunchingWithOptions called in background=\(application.applicationState == .background)") //------------- Preparing for start application. Stage 1. ----------------- @@ -119,7 +120,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { activateWithOpenUrl = false - DDLogInfo("(AppDelegate) Preparing for start application. Stage 1.") + LOG.info("Preparing for start application. Stage 1.") //------------ Interface Tuning ----------------------------------- self.window?.backgroundColor = UIColor.clear @@ -132,7 +133,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { - DDLogInfo("(AppDelegate) didFinishLaunchingWithOptions called in background=\(application.applicationState == .background)") + LOG.info("didFinishLaunchingWithOptions called in background=\(application.applicationState == .background)") SentrySDK.start { options in options.dsn = Constants.Sentry.dsnUrl @@ -144,7 +145,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } //------------- Preparing for start application. Stage 2. ----------------- - DDLogInfo("(AppDelegate) Preparing for start application. Stage 2.") + LOG.info("Preparing for start application. Stage 2.") let interval = resources.backgroundFetchUpdatePeriod.interval AppDelegate.setBackgroundFetchInterval(interval) @@ -169,10 +170,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate { if application.applicationState != .background { safariProtection.finishBackgroundUpdate { error in if let error = error { - DDLogError("(AppDelegate) - didFinishLaunchingWithOptions; Finished background update with error: \(error)") + LOG.error("didFinishLaunchingWithOptions; Finished background update with error: \(error)") return } - DDLogInfo("(AppDelegate) - didFinishLaunchingWithOptions; Finish background update successfully") + LOG.info("didFinishLaunchingWithOptions; Finish background update successfully") } } @@ -183,16 +184,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // MARK: - Application Delegate Methods func applicationWillResignActive(_ application: UIApplication) { - DDLogInfo("(AppDelegate) applicationWillResignActive.") + LOG.info("applicationWillResignActive.") } func applicationDidEnterBackground(_ application: UIApplication) { - DDLogInfo("(AppDelegate) applicationDidEnterBackground.") + LOG.info("applicationDidEnterBackground.") resources.synchronizeSharedDefaults() } func applicationWillEnterForeground(_ application: UIApplication) { - DDLogInfo("(AppDelegate) applicationWillEnterForeground.") + LOG.info("applicationWillEnterForeground.") configuration.checkContentBlockerEnabled() let safariConfig = SafariConfiguration(resources: resources, isProPurchased: purchaseService.isProPurchased) let dnsConfig = DnsConfiguration(resources: resources, isProPurchased: purchaseService.isProPurchased) @@ -201,7 +202,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } func applicationDidBecomeActive(_ application: UIApplication) { - DDLogInfo("(AppDelegate) applicationDidBecomeActive") + LOG.info("applicationDidBecomeActive") application.applicationIconBadgeNumber = 0 // If theme mode is System Default gets current style @@ -222,7 +223,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } func applicationWillTerminate(_ application: UIApplication) { - DDLogInfo("(AppDelegate) applicationWillTerminate.") + LOG.info("applicationWillTerminate.") resources.synchronizeSharedDefaults() } @@ -254,22 +255,22 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // we're holding an open file handle, for instance when we are working with a file or an SQLite database. So it // is rather dangerous since there are risks of data corruption. let backgroundTaskId = UIApplication.shared.beginBackgroundTask { - DDLogInfo("(AppDelegate) - backgroundFetch; background task is expiring, remaining time: \(UIApplication.shared.backgroundTimeRemaining)") + LOG.info("Background task is expiring, remaining time: \(UIApplication.shared.backgroundTimeRemaining)") } if backgroundTaskId == UIBackgroundTaskIdentifier.invalid { - DDLogError("(AppDelegate) - backgroundFetch; cannot start background operation") + LOG.error("Cannot start background operation") completionHandler(.noData) return } - DDLogInfo("(AppDelegate) - backgroundFetch; start, remaining time: \(UIApplication.shared.backgroundTimeRemaining)") + LOG.info("Start, remaining time: \(UIApplication.shared.backgroundTimeRemaining)") if UIApplication.shared.backgroundTimeRemaining < 20 { // If less than 20 seconds is available for the background task we simply don't run it. // The logic for using the 20 seconds limit: it takes at least 10 seconds to run rules conversion with the // default set of filter lists, and a couple more seconds on saving content blockers to files. - DDLogInfo("(AppDelegate) - backgroundFetch; remaining time is not enough to complete the task, exiting immediately") + LOG.info("Remaining time is not enough to complete the task, exiting immediately") UIApplication.shared.endBackgroundTask(backgroundTaskId) completionHandler(.noData) return @@ -280,12 +281,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { UIApplication.shared.endBackgroundTask(backgroundTaskId) completionHandler(result) - DDLogInfo("(AppDelegate) - backgroundFetch; finished successfully") + LOG.info("Finished successfully") } } func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { - DDLogError("(AppDelegate) application Open URL.") + LOG.error("Application Open URL.") activateWithOpenUrl = true if setappService.openUrl(url, options: options) { @@ -341,7 +342,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } let shouldUpdate = shouldUpdateFilters() - DDLogInfo("(AppDelegate) - backgroundFetch; shouldUpdateFilters=\(shouldUpdate)") + LOG.info("shouldUpdateFilters=\(shouldUpdate)") if !shouldUpdate { return .noData } @@ -359,7 +360,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { safariProtection.updateSafariProtectionInBackground { [weak self] result in if let error = result.error { - DDLogError("(AppDelegate) - backgroundFetch; received error from SDK: \(error)") + LOG.error("Received error from SDK: \(error)") bgFetchResult = result.backgroundFetchResult group.leave() return @@ -368,12 +369,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { if result.oldBackgroundFetchState == .updateFinished || result.oldBackgroundFetchState == .loadAndSaveFilters { // TODO: this is rather strange that we update DNS filters as a part of SafariProtection update. self?.dnsConfigAssistant.applyDnsPreferences(for: .modifiedDnsFilters) { _ in - DDLogInfo("(AppDelegate) - backgroundFetch; background fetch ended call performFetchWithCompletionHandler after updating dns preferences") + LOG.info("Background fetch ended call performFetchWithCompletionHandler after updating dns preferences") bgFetchResult = result.backgroundFetchResult group.leave() } } else { - DDLogInfo("(AppDelegate) - backgroundFetch; background fetch ended call performFetchWithCompletionHandler") + LOG.info("Background fetch ended call performFetchWithCompletionHandler") bgFetchResult = result.backgroundFetchResult group.leave() } @@ -387,7 +388,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { setappService.start() guard let mainPageController = getMainPageController() else { - DDLogError("mainPageController is nil") + LOG.error("mainPageController is nil") return } @@ -400,14 +401,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } guard let dnsLogContainerVC = getDnsLogContainerController() else { - DDLogError("dnsLogContainerVC is nil") + LOG.error("dnsLogContainerVC is nil") return } /** To quickly show stats in ActivityViewController, we load ViewController when app starts */ dnsLogContainerVC.loadViewIfNeeded() - DDLogInfo("Finished preparing controllers") + LOG.info("Finished preparing controllers") } // TODO: - Change the way we show overlimit error for DNS filters and handle the error @@ -434,7 +435,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { purchaseObservation = NotificationCenter.default.observe(name: Notification.Name(PurchaseAssistant.kPurchaseServiceNotification), object: nil, queue: nil) { (notification) in guard let type = notification.userInfo?[PurchaseAssistant.kPSNotificationTypeKey] as? String else { return } - DDLogInfo("(AppDelegate) - Received notification type = \(type)") + LOG.info("Received notification type = \(type)") if type == PurchaseAssistant.kPSNotificationPremiumExpired { self.userNotificationService.postNotification(title: String.localizedString("premium_expired_title"), body: String.localizedString("premium_expired_message"), userInfo: nil) @@ -447,10 +448,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate { guard let self = self else { return } if !self.configuration.proStatus && self.vpnManager.vpnInstalled { - DDLogInfo("(AppDelegate) Remove vpn configuration") + LOG.info("Remove vpn configuration") self.vpnManager.removeVpnConfiguration { (error) in if error != nil { - DDLogError("(AppDelegate) Remove vpn configuration failed: \(error!)") + LOG.error("Remove vpn configuration failed: \(error!)") } } } @@ -473,58 +474,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } } - // MARK: - Init logger - - private static func initLogger(resources: AESharedResourcesProtocol) { - let isDebugLogs = resources.sharedDefaults().bool(forKey: AEDefaultsDebugLogs) - dynamicLogLevel = isDebugLogs ? .debug : .info - ACLLogger.singleton()?.initLogger(resources.sharedAppLogsURL()) - ACLLogger.singleton()?.logLevel = isDebugLogs ? ACLLDebugLevel : ACLLDefaultLevel - - DDLogInfo("(AppDelegate) - Init app, log level debug=\(isDebugLogs)") - - #if DEBUG - ACLLogger.singleton()?.logLevel = ACLLDebugLevel - #endif - - AGLogger.setLevel(isDebugLogs ? .AGLL_DEBUG : .AGLL_INFO) - AGLogger.setCallback { level, msg, length in - guard let msg = msg else { return } - let data = Data(bytes: msg, count: Int(length)) - if let str = String(data: data, encoding: .utf8) { - switch (level) { - case AGLogLevel.AGLL_INFO: - Logger.logInfo("(DnsLibs) - \(str)") - case AGLogLevel.AGLL_ERR, AGLogLevel.AGLL_WARN: - Logger.logError("(DnsLibs) - \(str)") - default: - Logger.logDebug("(DnsLibs) - \(str)") - } - } - } - - Logger.logDebug = { msg in - DDLogDebug(msg) - } - - Logger.logInfo = { msg in - DDLogInfo(msg) - } - - Logger.logError = { msg in - DDLogError(msg) - } - } - private func setupOnFirstAppRun() { guard firstRun else { return } firstRun = false do { try safariProtection.enablePredefinedGroupsAndFilters() - DDLogInfo("(AppDelegate) - setupOnFirstAppRun; Successfully setup predefined groups and filters") + LOG.info("Successfully setup predefined groups and filters") } catch { - DDLogError("(AppDelegate) - setupOnFirstAppRun; Error occurred while setup predefined groups and filters") + LOG.error("Error occurred while setup predefined groups and filters") } updateSafariProtectionMeta() @@ -534,19 +492,19 @@ class AppDelegate: UIResponder, UIApplicationDelegate { safariProtection.updateFiltersMetaAndLocalizations(true) { result in switch result { case .success(_): - DDLogInfo("(AppDelegate) - updateSafariProtectionMeta; Safari protection meta successfully updated") + LOG.info("Safari protection meta successfully updated") case .error(let error): - DDLogError("(AppDelegate) - updateSafariProtectionMeta; On update safari protection meta error occurred: \(error)") + LOG.error("On update safari protection meta error occurred: \(error)") } } onCbReloaded: { error in if let error = error { - DDLogError("(AppDelegate) - updateSafariProtectionMeta; On reload CB error occurred: \(error)") + LOG.error("On reload CB error occurred: \(error)") return } - DDLogInfo("(AppDelegate) - updateSafariProtectionMeta; Successfully reload CB") + LOG.info("Successfully reload CB") } } } diff --git a/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+CheckPeriod.swift b/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+CheckPeriod.swift index b67dc8f64..b0efc232b 100644 --- a/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+CheckPeriod.swift +++ b/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+CheckPeriod.swift @@ -16,16 +16,20 @@ // along with Adguard for iOS. If not, see . // +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(AppDelegate.self) + // Set period for minimum background fetch interval extension AppDelegate { static func setBackgroundFetchInterval(_ interval: TimeInterval) { guard interval >= UIApplication.backgroundFetchIntervalMinimum else { UIApplication.shared.setMinimumBackgroundFetchInterval(UIApplication.backgroundFetchIntervalMinimum) - DDLogError("(AppDelegate) - setBackgroundFetchInterval; Background fetch period=\(interval) is to low") + LOG.error("Background fetch period=\(interval) is to low") return } UIApplication.shared.setMinimumBackgroundFetchInterval(interval) - DDLogInfo("(AppDelegate) Set background fetch interval=\(interval)") + LOG.info("Set background fetch interval=\(interval)") } } diff --git a/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+IURLSchemeExecutor.swift b/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+IURLSchemeExecutor.swift index ff213568c..60dbe1be3 100644 --- a/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+IURLSchemeExecutor.swift +++ b/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+IURLSchemeExecutor.swift @@ -17,6 +17,9 @@ // import SafariAdGuardSDK +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(AppDelegate.self) extension AppDelegate: IURLSchemeExecutor { @@ -57,23 +60,23 @@ extension AppDelegate: IURLSchemeExecutor { } func openUserRulesRedirectController(for action: UserRulesRedirectAction) -> Bool { - DDLogInfo("(AppDelegate) - open UserRulesRedirectController with action = \(action)") + LOG.info("Open UserRulesRedirectController with action = \(action)") return self.presentUserRulesRedirectController(for: action) } func openMainPageControllerAndTurnOnProtection(for domain: String) -> Bool { - DDLogInfo("(AppDelegate) - openMainPageControllerAndTurnOnProtection for domain=\(domain) ") + LOG.info("Open MainPageController and turn on protection for domain=\(domain) ") return self.presentMainPageControllerAndTurnOnProtection(for: domain) } func openPurchaseLicenseController() -> Bool { - DDLogInfo("(AppDelegate) - open PurchaseLicenseController") + LOG.info("Open PurchaseLicenseController") return self.presentPurchaseLicenseController() } func openAdvancedProtectionController(enableAdvancedProtection: Bool?) -> Bool { let enabledState = enableAdvancedProtection == nil ? "nil" : "\(enableAdvancedProtection!)" - DDLogInfo("(AppDelegate) - open openAdvancedProtectionController; enabledAdvancedProtection = \(enabledState)") + LOG.info("Open AdvancedProtectionController = \(enabledState)") return self.presentAdvancedProtectionController(enableAdvancedProtection: enableAdvancedProtection) } } diff --git a/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+PresentController.swift b/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+PresentController.swift index b71794ae9..3c4801a48 100644 --- a/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+PresentController.swift +++ b/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+PresentController.swift @@ -17,7 +17,9 @@ // import UIKit -import enum SharedAdGuardSDK.UserRuleType +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(AppDelegate.self) // TODO: - We should check all these methods because practically all the screens changed extension AppDelegate { @@ -39,7 +41,7 @@ extension AppDelegate { /* Returns MainPageController from current navigation stack */ func getMainPageController() -> MainPageController? { guard let navController = getNavigationController(for: .mainTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return nil } @@ -50,7 +52,7 @@ extension AppDelegate { /* Returns DnsLogContainerController from current navigation stack */ func getDnsLogContainerController() -> DnsLogContainerController? { guard let navController = getNavigationController(for: .activityTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return nil } @@ -64,12 +66,12 @@ extension AppDelegate { */ @discardableResult func presentDnsSettingsController(showLaunchScreen: Bool = false, dnsProtectionIsEnabled enabled: Bool? = nil) -> Bool { guard let tabBar = getMainTabController() else { - DDLogError("Tab bar is nil") + LOG.error("Tab bar is nil") return false } guard let navController = getNavigationController(for: .protectionTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return false } @@ -78,13 +80,13 @@ extension AppDelegate { } guard let complexProtectionController = navController.viewControllers.first as? ComplexProtectionController else { - DDLogError("Navigation controller first VC is not ComplexProtectionController") + LOG.error("Navigation controller first VC is not ComplexProtectionController") return false } let dnsSettingsStoryBoard = UIStoryboard(name: "DnsSettings", bundle: Bundle.main) guard let dnsSettingsController = dnsSettingsStoryBoard.instantiateViewController(withIdentifier: "DnsSettingsController") as? DnsSettingsController else { - DDLogError("DnsSettings.storyboard doesn't have DnsSettingsController") + LOG.error("DnsSettings.storyboard doesn't have DnsSettingsController") return false } dnsSettingsController.stateFromWidget = enabled @@ -103,12 +105,12 @@ extension AppDelegate { */ func presentMainPageController(showLaunchScreen: Bool = false, complexProtectionIsEnabled enabled: Bool? = nil) -> Bool { guard let tabBar = getMainTabController() else { - DDLogError("Tab bar is nil") + LOG.error("Tab bar is nil") return false } guard let navController = getNavigationController(for: .mainTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return false } @@ -118,7 +120,7 @@ extension AppDelegate { let mainPageStoryboard = UIStoryboard(name: "MainPage", bundle: Bundle.main) guard let mainPageController = mainPageStoryboard.instantiateViewController(withIdentifier: "MainPageController") as? MainPageController else { - DDLogError("MainPage.storyboard doesn't have MainPageController") + LOG.error("MainPage.storyboard doesn't have MainPageController") return false } mainPageController.stateFromWidget = enabled @@ -141,12 +143,12 @@ extension AppDelegate { } guard let tabBar = getMainTabController() else { - DDLogError("Tab bar is nil") + LOG.error("Tab bar is nil") return false } guard let navController = getNavigationController(for: .mainTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return false } @@ -156,18 +158,18 @@ extension AppDelegate { let mainPageStoryboard = UIStoryboard(name: "MainPage", bundle: Bundle.main) guard let mainPageController = mainPageStoryboard.instantiateViewController(withIdentifier: "MainPageController") as? MainPageController else { - DDLogError("MainPage.storyboard doesn't have MainPageController") + LOG.error("MainPage.storyboard doesn't have MainPageController") return false } let licenseStoryboard = UIStoryboard(name: "License", bundle: Bundle.main) guard let licenseController = licenseStoryboard.instantiateViewController(withIdentifier: "LicensePageViewController") as? LicensePageViewController else { - DDLogError("License.storyboard doesn't have LicensePageViewController") + LOG.error("License.storyboard doesn't have LicensePageViewController") return false } guard let loginController = licenseStoryboard.instantiateViewController(withIdentifier: "EmailSignInScene") as? EmailSignInController else { - DDLogError("License.storyboard doesn't have EmailSignInController") + LOG.error("License.storyboard doesn't have EmailSignInController") return false } loginController.licenseKey = key @@ -188,12 +190,12 @@ extension AppDelegate { if !proStatus { return presentPurchaseLicenseController() } guard let tabBar = getMainTabController() else { - DDLogError("Tab bar is nil") + LOG.error("Tab bar is nil") return false } guard let navController = getNavigationController(for: .protectionTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return false } @@ -202,18 +204,18 @@ extension AppDelegate { } guard let complexProtectionController = navController.viewControllers.first as? ComplexProtectionController else { - DDLogError("Navigation controller first VC is not ComplexProtectionController") + LOG.error("Navigation controller first VC is not ComplexProtectionController") return false } let dnsSettingsStoryBoard = UIStoryboard(name: "DnsSettings", bundle: Bundle.main) guard let dnsSettingsController = dnsSettingsStoryBoard.instantiateViewController(withIdentifier: "DnsSettingsController") as? DnsSettingsController else { - DDLogError("DnsSettings.storyboard doesn't have DnsSettingsController") + LOG.error("DnsSettings.storyboard doesn't have DnsSettingsController") return false } guard let dnsProvidersController = dnsSettingsStoryBoard.instantiateViewController(withIdentifier: "DnsProvidersController") as? DnsProvidersController else { - DDLogError("DnsSettings.storyboard doesn't have DnsProvidersController") + LOG.error("DnsSettings.storyboard doesn't have DnsProvidersController") return false } dnsProvidersController.openUpstream = upstream @@ -233,14 +235,14 @@ extension AppDelegate { */ func presentFiltersMasterController(showLaunchScreen: Bool = false, url: String? = nil, title: String? = nil) -> Bool { if !proStatus { return presentPurchaseLicenseController() } - + guard let tabBar = getMainTabController() else { - DDLogError("Tab bar is nil") + LOG.error("Tab bar is nil") return false } guard let navController = getNavigationController(for: .protectionTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return false } @@ -249,24 +251,24 @@ extension AppDelegate { } guard let complexProtectionController = navController.viewControllers.first as? ComplexProtectionController else { - DDLogError("Navigation controller first VC is not ComplexProtectionController") + LOG.error("Navigation controller first VC is not ComplexProtectionController") return false } let filtersStoryboard = UIStoryboard(name: "Filters", bundle: Bundle.main) guard let safariProtectionController = filtersStoryboard.instantiateViewController(withIdentifier: "SafariProtectionController") as? SafariProtectionController else { - DDLogError("Filters.storyboard doesn't have SafariProtectionController") + LOG.error("Filters.storyboard doesn't have SafariProtectionController") return false } guard let safariGroupTableController = filtersStoryboard.instantiateViewController(withIdentifier: "SafariGroupTableController") as? SafariGroupTableController else { - DDLogError("Filters.storyboard doesn't have SafariGroupTableController") + LOG.error("Filters.storyboard doesn't have SafariGroupTableController") return false } safariGroupTableController.loadViewIfNeeded() guard let safariGroupFiltersTableController = filtersStoryboard.instantiateViewController(withIdentifier: "SafariGroupFiltersTableController") as? SafariGroupFiltersTableController else { - DDLogError("Filters.storyboard doesn't have SafariGroupFiltersTableController") + LOG.error("Filters.storyboard doesn't have SafariGroupFiltersTableController") return false } @@ -290,12 +292,12 @@ extension AppDelegate { func presentDnsFiltersController(showLaunchScreen: Bool = false) -> Bool { // guard let tabBar = getMainTabController() else { -// DDLogError("Tab bar is nil") +// LOG.error("Tab bar is nil") // return false // } // // guard let navController = getNavigationController(for: .protectionTab) else { -// DDLogError("Navigation controller is nil") +// LOG.error("Navigation controller is nil") // return false // } // @@ -304,23 +306,23 @@ extension AppDelegate { // } // // guard let complexProtectionController = navController.viewControllers.first as? ComplexProtectionController else { -// DDLogError("Navigation controller first VC is not ComplexProtectionController") +// LOG.error("Navigation controller first VC is not ComplexProtectionController") // return false // } // // let dnsSettingsStoryboard = UIStoryboard(name: "DnsSettings", bundle: nil) // guard let dnsSettingsController = dnsSettingsStoryboard.instantiateViewController(withIdentifier: "DnsSettingsController") as? DnsSettingsController else { -// DDLogError("DnsSettings.storyboard doesnt't have DnsSettingsController") +// LOG.error("DnsSettings.storyboard doesnt't have DnsSettingsController") // return false // } // // guard let requestsBlockingController = dnsSettingsStoryboard.instantiateViewController(withIdentifier: "RequestsBlockingController") as? RequestsBlockingController else { -// DDLogError("DnsSettings.storyboard doesnt't have RequestsBlockingController") +// LOG.error("DnsSettings.storyboard doesnt't have RequestsBlockingController") // return false // } // // guard let dnsFiltersController = dnsSettingsStoryboard.instantiateViewController(withIdentifier: "DnsFiltersController") as? DnsFiltersController else { -// DDLogError("DnsSettings.storyboard doesnt't have DnsFiltersController") +// LOG.error("DnsSettings.storyboard doesnt't have DnsFiltersController") // return false // } // dnsFiltersController.loadViewIfNeeded() @@ -337,12 +339,12 @@ extension AppDelegate { */ func presentRateAppController() { guard let topVC = Self.topViewController() else { - DDLogError("Failed to get top view controller") + LOG.error("Failed to get top view controller") return } let rateAppStoryboard = UIStoryboard(name: "RateApp", bundle: nil) guard let rateAppController = rateAppStoryboard.instantiateViewController(withIdentifier: "RateAppController") as? RateAppController else { - DDLogError("RateApp.storyboard doesnt't have RateAppController") + LOG.error("RateApp.storyboard doesnt't have RateAppController") return } // Check if VC does not present any controller @@ -357,12 +359,12 @@ extension AppDelegate { */ func presentRateAppProblemController() { guard let topVC = Self.topViewController() else { - DDLogError("Failed to get top view controller") + LOG.error("Failed to get top view controller") return } let rateAppStoryboard = UIStoryboard(name: "RateApp", bundle: nil) guard let rateAppController = rateAppStoryboard.instantiateViewController(withIdentifier: "RateAppProblemController") as? RateAppProblemController else { - DDLogError("RateApp.storyboard doesnt't have RateAppProblemController") + LOG.error("RateApp.storyboard doesnt't have RateAppProblemController") return } // Check if VC does not present any controller @@ -374,28 +376,28 @@ extension AppDelegate { func presentBugReportController() { guard let tabBar = getMainTabController() else { - DDLogError("Tab bar is nil") + LOG.error("Tab bar is nil") return } guard let navController = getNavigationController(for: .settingTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return } guard let mainMenuController = navController.viewControllers.first as? MainMenuController else { - DDLogError("Navigation controller first VC is not MainMenuController") + LOG.error("Navigation controller first VC is not MainMenuController") return } let mainMenuStoryBoard = UIStoryboard(name: "MainMenu", bundle: nil) guard let supportVC = mainMenuStoryBoard.instantiateViewController(withIdentifier: "SupportTableViewController") as? SupportTableViewController else { - DDLogError("MainMenu.storyboard doesnt't have SupportTableViewController") + LOG.error("MainMenu.storyboard doesnt't have SupportTableViewController") return } guard let bugReportVC = mainMenuStoryBoard.instantiateViewController(withIdentifier: "BugReportController") as? BugReportController else { - DDLogError("MainMenu.storyboard doesnt't have BugReportController") + LOG.error("MainMenu.storyboard doesnt't have BugReportController") return } @@ -412,12 +414,12 @@ extension AppDelegate { */ func presentTunnelModeController(showLaunchScreen: Bool = false) -> Bool { guard let tabBar = getMainTabController() else { - DDLogError("Tab bar is nil") + LOG.error("Tab bar is nil") return false } guard let navController = getNavigationController(for: .settingTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return false } @@ -426,7 +428,7 @@ extension AppDelegate { } guard let mainMenuController = navController.viewControllers.first as? MainMenuController else { - DDLogError("Navigation controller first VC is not MainMenuController") + LOG.error("Navigation controller first VC is not MainMenuController") return false } @@ -435,7 +437,7 @@ extension AppDelegate { let advancedSettingsController = settingsStoryBoard.instantiateViewController(withIdentifier: "AdvancedSettingsController") as? AdvancedSettingsController, let dnsModeController = settingsStoryBoard.instantiateViewController(withIdentifier: "DnsModeController") as? DnsModeController else { - DDLogError("Missing controller from Settings.storyboard") + LOG.error("Missing controller from Settings.storyboard") return false } @@ -465,12 +467,12 @@ extension AppDelegate { */ func dismissToMainPage(animated: Bool = false) { guard let tabBar = self.getMainTabController() else { - DDLogError("Tab bar is nil") + LOG.error("Tab bar is nil") return } guard let navController = self.getNavigationController(for: .mainTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return } @@ -489,11 +491,11 @@ extension AppDelegate { func presentHowToSetupController() { let dnsStoryboard = UIStoryboard(name: "DnsSettings", bundle: nil) guard let howToSetupVC = dnsStoryboard.instantiateViewController(withIdentifier: "HowToSetupController") as? HowToSetupController else { - DDLogError("DnsSettings.storyboard doesn't have HowToSetupController") + LOG.error("DnsSettings.storyboard doesn't have HowToSetupController") return } guard let topVC = AppDelegate.topViewController() else { - DDLogError("Failed to get top view controller") + LOG.error("Failed to get top view controller") return } topVC.present(howToSetupVC, animated: true, completion: nil) @@ -505,12 +507,12 @@ extension AppDelegate { */ func presentImportSettingsController(showLaunchScreen: Bool = false, settings: ImportSettings) -> Bool { guard let tabBar = getMainTabController() else { - DDLogError("Tab bar is nil") + LOG.error("Tab bar is nil") return false } guard let navController = getNavigationController(for: .mainTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return false } @@ -520,7 +522,7 @@ extension AppDelegate { let mainPageStoryboard = UIStoryboard(name: "MainPage", bundle: Bundle.main) guard let mainPageController = mainPageStoryboard.instantiateViewController(withIdentifier: "MainPageController") as? MainPageController else { - DDLogError("MainPage.storyboard doesn't have MainPageController") + LOG.error("MainPage.storyboard doesn't have MainPageController") return false } mainPageController.importSettings = settings @@ -534,12 +536,12 @@ extension AppDelegate { func presentUserRulesRedirectController(for action: UserRulesRedirectAction) -> Bool { guard let topVC = Self.topViewController() else { - DDLogError("Failed to get top view controller") + LOG.error("Failed to get top view controller") return false } let userFilterStoryboard = UIStoryboard(name: "UserFilter", bundle: nil) guard let userRulesRedirectVC = userFilterStoryboard.instantiateViewController(withIdentifier: "UserRulesRedirectController") as? UserRulesRedirectController else { - DDLogError("UserFilter.storyboard doesn't have UserRulesRedirectController") + LOG.error("UserFilter.storyboard doesn't have UserRulesRedirectController") return false } @@ -551,7 +553,7 @@ extension AppDelegate { self.presentUserRulesTableController(for: userRulesTableController.rulesType) } } - + userRulesRedirectVC.action = action topVC.present(userRulesRedirectVC, animated: true) return true @@ -562,18 +564,18 @@ extension AppDelegate { func presentMainPageControllerAndTurnOnProtection(for domain: String) -> Bool { guard let tabBar = getMainTabController() else { - DDLogError("Tab bar is nil") + LOG.error("Tab bar is nil") return false } guard let navController = getNavigationController(for: .mainTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return false } let mainPageStoryboard = UIStoryboard(name: "MainPage", bundle: Bundle.main) guard let mainPageController = mainPageStoryboard.instantiateViewController(withIdentifier: "MainPageController") as? MainPageController else { - DDLogError("MainPage.storyboard doesn't have MainPageController") + LOG.error("MainPage.storyboard doesn't have MainPageController") return false } @@ -591,24 +593,24 @@ extension AppDelegate { if proStatus { return false } guard let tabBar = getMainTabController() else { - DDLogError("Tab bar is nil") + LOG.error("Tab bar is nil") return false } guard let navController = getNavigationController(for: .mainTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return false } let mainPageStoryboard = UIStoryboard(name: "MainPage", bundle: Bundle.main) guard let mainPageController = mainPageStoryboard.instantiateViewController(withIdentifier: "MainPageController") as? MainPageController else { - DDLogError("MainPage.storyboard doesnt't have MainPageController") + LOG.error("MainPage.storyboard doesnt't have MainPageController") return false } let licenseStoryboard = UIStoryboard(name: "License", bundle: Bundle.main) guard let licenseController = licenseStoryboard.instantiateViewController(withIdentifier: "LicensePageViewController") as? LicensePageViewController else { - DDLogError("License.storyboard doesnt't have LicensePageViewController") + LOG.error("License.storyboard doesnt't have LicensePageViewController") return false } @@ -621,30 +623,30 @@ extension AppDelegate { func presentUserRulesTableController(for type: UserRuleType) { guard let tabBar = getMainTabController() else { - DDLogError("Tab bar is nil") + LOG.error("Tab bar is nil") return } guard let navController = getNavigationController(for: .protectionTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return } let protectionStoryboard = UIStoryboard(name: "Protection", bundle: .main) guard let complexProtectionController = protectionStoryboard.instantiateViewController(withIdentifier: "ComplexProtectionController") as? ComplexProtectionController else { - DDLogError("Protection.storyboard doesnt't have ComplexProtectionController") + LOG.error("Protection.storyboard doesnt't have ComplexProtectionController") return } let filtersStoryboard = UIStoryboard(name: "Filters", bundle: .main) guard let safariProtectionController = filtersStoryboard.instantiateViewController(withIdentifier: "SafariProtectionController") as? SafariProtectionController else { - DDLogError("Filters.storyboard doesnt't have SafariProtectionController") + LOG.error("Filters.storyboard doesnt't have SafariProtectionController") return } let userFilterStoryboard = UIStoryboard(name: "UserFilter", bundle: .main) guard let userRulesTableController = userFilterStoryboard.instantiateViewController(withIdentifier: "UserRulesTableController") as? UserRulesTableController else { - DDLogError("UserFilter.storyboard doesnt't have UserRulesTableController") + LOG.error("UserFilter.storyboard doesnt't have UserRulesTableController") return } @@ -659,22 +661,22 @@ extension AppDelegate { func presentAdvancedProtectionController(enableAdvancedProtection: Bool? = nil) -> Bool { guard let tabBar = getMainTabController() else { - DDLogError("Tab bar is nil") + LOG.error("Tab bar is nil") return false } guard let navController = getNavigationController(for: .protectionTab) else { - DDLogError("Navigation controller is nil") + LOG.error("Navigation controller is nil") return false } let protectionStoryboard = UIStoryboard(name: "Protection", bundle: .main) guard let complexProtectionController = protectionStoryboard.instantiateViewController(withIdentifier: "ComplexProtectionController") as? ComplexProtectionController else { - DDLogError("Protection.storyboard doesnt't have ComplexProtectionController") + LOG.error("Protection.storyboard doesnt't have ComplexProtectionController") return false } guard let advancedProtectionController = protectionStoryboard.instantiateViewController(withIdentifier: "AdvancedProtectionController") as? AdvancedProtectionController else { - DDLogError("Protection.storyboard doesnt't have AdvancedProtectionController") + LOG.error("Protection.storyboard doesnt't have AdvancedProtectionController") return false } diff --git a/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+UserNotifications.swift b/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+UserNotifications.swift index 61c750a08..f76774612 100644 --- a/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+UserNotifications.swift +++ b/AdguardExtension/AdguardApp/AppDelegate/Extensions/AppDelegate+UserNotifications.swift @@ -16,6 +16,10 @@ // along with Adguard for iOS. If not, see . // +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(AppDelegate.self) + // Handle UserNotificationService notifications extension AppDelegate { func subscribeToUserNotificationServiceNotifications() { @@ -31,7 +35,7 @@ extension AppDelegate { @objc private func openDnsFiltersController(notification: Notification) { let success = presentDnsFiltersController() - DDLogInfo("Presented DnsFiltersController successfully = \(success ? "Yes" : "No")") + LOG.info("Presented DnsFiltersController successfully = \(success ? "Yes" : "No")") } private func showCommonAlertForTopVc(_ body: String?, _ title: String?) { diff --git a/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/OpenDnsProvidersControllerWithAdguardParser.swift b/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/OpenDnsProvidersControllerWithAdguardParser.swift index 9f74819bf..b3d9d9bb3 100644 --- a/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/OpenDnsProvidersControllerWithAdguardParser.swift +++ b/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/OpenDnsProvidersControllerWithAdguardParser.swift @@ -17,6 +17,9 @@ // import Foundation +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(OpenDnsProvidersControllerWithAdguardParser.self) /// this object should be used for parsing "adguard:add_dns_server" urls struct OpenDnsProvidersControllerWithAdguardParser: IURLSchemeParametersParser { @@ -29,7 +32,7 @@ struct OpenDnsProvidersControllerWithAdguardParser: IURLSchemeParametersParser { func parse(_ url: URL) -> Bool { let params = url.parseUrl().params guard let upstream = params?["address"], !upstream.isEmpty else { - DDLogError("OpenDnsProvidersControllerWithAdguardParser error: there is no 'address' field in url: \(url.absoluteString)") + LOG.error("OpenDnsProvidersControllerWithAdguardParser error: there is no 'address' field in url: \(url.absoluteString)") return false } diff --git a/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/OpenImportSettingsControllerParser.swift b/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/OpenImportSettingsControllerParser.swift index 323d8dfa8..564a0326d 100644 --- a/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/OpenImportSettingsControllerParser.swift +++ b/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/OpenImportSettingsControllerParser.swift @@ -15,6 +15,9 @@ // You should have received a copy of the GNU General Public License // along with Adguard for iOS. If not, see . // +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(OpenImportSettingsControllerParser.self) struct OpenImportSettingsControllerParser: IURLSchemeParametersParser { private let executor: IURLSchemeExecutor @@ -30,7 +33,7 @@ struct OpenImportSettingsControllerParser: IURLSchemeParametersParser { let settings = try parser.parse(query: json) return executor.openImportSettingsController(showLaunchScreen: true, settings: settings) } catch { - DDLogError("(OpenImportSettingsControllerParser) - parse; Error occurred while parsing json = \(json)") + LOG.error("Error occurred while parsing json = \(json)") return false } } diff --git a/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/OpenUserFilterControllerParser.swift b/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/OpenUserFilterControllerParser.swift index 1b0e2148a..620534aee 100644 --- a/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/OpenUserFilterControllerParser.swift +++ b/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/OpenUserFilterControllerParser.swift @@ -16,6 +16,10 @@ // along with Adguard for iOS. If not, see . // +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(OpenUserFilterControllerParser.self) + struct OpenUserFilterControllerParser: IURLSchemeParametersParser { private let executor: IURLSchemeExecutor @@ -27,13 +31,13 @@ struct OpenUserFilterControllerParser: IURLSchemeParametersParser { func parse(_ url: URL) -> Bool { let rule = String(url.path.suffix(url.path.count - 1)) if rule.isEmpty { - DDLogError("(OpenUserFilterControllerParser) - parse; Failed to get rule from URL=\(url.absoluteString)") + LOG.error("Failed to get rule from URL=\(url.absoluteString)") return false } let result = Domain.findDomains(in: rule) if result.isEmpty { - DDLogError("(OpenUserFilterControllerParser) - parse; Failed to get absolute domain string from string=\(rule)") + LOG.error("Failed to get absolute domain string from string=\(rule)") return false } diff --git a/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/SafariWebExtensionParametersParser.swift b/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/SafariWebExtensionParametersParser.swift index 10b31cb30..4237fb05b 100644 --- a/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/SafariWebExtensionParametersParser.swift +++ b/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/SafariWebExtensionParametersParser.swift @@ -17,6 +17,9 @@ // import Foundation +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(SafariWebExtensionParametersParser.self) /// This object is responsible for obtaining parameters from app scheme links /// And performing an action considering these parameters @@ -32,7 +35,7 @@ struct SafariWebExtensionParametersParser: IURLSchemeParametersParser { let encodedDomain = url.parseUrl().params?["domain"], let decodedDomain = encodedDomain.removingPercentEncoding else { - DDLogError("Failed to extract info from url=\(url.absoluteString)") + LOG.error("Failed to extract info from url=\(url.absoluteString)") return false } @@ -43,7 +46,7 @@ struct SafariWebExtensionParametersParser: IURLSchemeParametersParser { let result = Domain.findDomains(in: decodedDomain) if result.isEmpty { - DDLogError("(SafariWebExtensionParametersParser) - parse; Failed to get absolute domain string from string=\(decodedDomain)") + LOG.error("Failed to get absolute domain string from string=\(decodedDomain)") return false } diff --git a/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/SocialNetworkAuthParametersParser.swift b/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/SocialNetworkAuthParametersParser.swift index b148b7256..e544f6cfd 100644 --- a/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/SocialNetworkAuthParametersParser.swift +++ b/AdguardExtension/AdguardApp/AppDelegate/URLScheme/Parsers/SocialNetworkAuthParametersParser.swift @@ -16,6 +16,10 @@ // along with Adguard for iOS. If not, see . // +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(SocialNetworkAuthParametersParser.self) + struct SocialNetworkAuthParametersParser: IURLSchemeParametersParser { private let executor: IURLSchemeExecutor private let socialErrorUserNotFound = "user_not_found" @@ -40,7 +44,7 @@ struct SocialNetworkAuthParametersParser: IURLSchemeParametersParser { private func socialLoginErrorProcessor(error: String) { var userInfo = [AnyHashable: Any]() - DDLogInfo("(URLSchemeProcessor) Social login error: \(error)") + LOG.info("Social login error: \(error)") switch error { case socialErrorUserNotFound: userInfo[PurchaseAssistant.kPSNotificationTypeKey] = PurchaseAssistant.kPSNotificationLoginUserNotFound diff --git a/AdguardExtension/AdguardApp/AppDelegate/URLScheme/URLSchemeParser.swift b/AdguardExtension/AdguardApp/AppDelegate/URLScheme/URLSchemeParser.swift index e80360eb6..e672b943d 100644 --- a/AdguardExtension/AdguardApp/AppDelegate/URLScheme/URLSchemeParser.swift +++ b/AdguardExtension/AdguardApp/AppDelegate/URLScheme/URLSchemeParser.swift @@ -37,6 +37,7 @@ 12. ://enableAdvancedProtection <--- Open Advanced protection screen 13. ://add_dns_server?address:&name: <--- Adding custom DNS server */ +import SharedAdGuardSDK protocol IURLSchemeParser { func parse(url: URL) -> Bool @@ -75,6 +76,8 @@ fileprivate enum StringConstants: String { } } +private let LOG = LoggerFactory.getLoggerWrapper(URLSchemeParser.self) + struct URLSchemeParser: IURLSchemeParser { private let executor: IURLSchemeExecutor @@ -95,79 +98,79 @@ struct URLSchemeParser: IURLSchemeParser { switch (scheme, command) { // Adding new user rule from safari case (.urlScheme, .urlSchemeCommandAdd): - DDLogInfo("(URLSchemeParser) openurl - adding new user rule from safari") + LOG.info("Openurl - adding new user rule from safari") let processor = OpenUserFilterControllerParser(executor: executor) return processor.parse(url) // Turning on/off DNS protection from widget case (.urlScheme, .openSystemProtection): - DDLogInfo("(URLSchemeParser) openurl - turning on/off DNS protection from widget") + LOG.info("Openurl - turning on/off DNS protection from widget") let processor = OpenDnsSettingsControllerWithLaunchScreenParser(executor: executor) return processor.parse(url) // Turning on/off complex protection from widget case (.urlScheme, .openComplexProtection): - DDLogInfo("(URLSchemeParser) openurl - turning on/off complex protection from widget") + LOG.info("Openurl - turning on/off complex protection from widget") let processor = OpenMainPageControllerControllerWithLaunchScreenParser(executor: executor) return processor.parse(url) // Activate license by URL case (.urlScheme, .activateLicense): - DDLogInfo("(URLSchemeParser) - activate license key from openUrl") + LOG.info("Activate license key from openUrl") let loginParser = OpenLoginControllerParser(executor: executor) return loginParser.parse(url) // Adding custom DNS server case (.sdnsScheme, _): - DDLogInfo("(URLSchemeParser) openurl sdns: \(url.absoluteString)") + LOG.info("Openurl sdns: \(url.absoluteString)") let processor = OpenDnsProvidersControllerWithSDNSParser(executor: executor) return processor.parse(url) // Adding custom DNS server case (.urlScheme, .addDnsServer): - DDLogInfo("(URLSchemeParser) openurl - add dns server: \(url.absoluteString)") + LOG.info("Openurl - add dns server: \(url.absoluteString)") let processor = OpenDnsProvidersControllerWithAdguardParser(executor: executor) return processor.parse(url) // Import settings case (.urlScheme, .applySettings): - DDLogInfo("(URLSchemeParser) openurl - apply settings") + LOG.info("Openurl - apply settings") let processor = OpenImportSettingsControllerParser(executor: executor) return processor.parse(url) // Subscribe to custom safari filter case (_, .subscribe): - DDLogInfo("(URLSchemeParser) openurl - subscribe filter") + LOG.info("Openurl - subscribe filter") let processor = OpenFiltersMasterControllerParser(executor: executor) return processor.parse(url) // Open Tunnel Mode settings case (_, .openTunnelModeSettings): - DDLogInfo("(URLSchemeParser) openurl - open tunnel mode settings") + LOG.info("Openurl - open tunnel mode settings") let processor = OpenTunnelModeControllerParser(executor: executor) return processor.parse(url) // Log in by social networks case (.urlScheme, .authScheme): - DDLogInfo("(URLSchemeParser) openurl - Log in by social networks") + LOG.info("Openurl - Log in by social networks") let processor = SocialNetworkAuthParametersParser(executor: executor) return processor.parse(url) // Open with safari web extension action case (.inAppUrlScheme, .urlSchemeSafariWebExtension): - DDLogInfo("(URLSchemeParser) openurl - open with safari web extension action") + LOG.info("Openurl - open with safari web extension action") let processor = SafariWebExtensionParametersParser(executor: executor) return processor.parse(url) // Open license controller case (.inAppUrlScheme, .upgradeApp): - DDLogInfo("(URLSchemeParser) openurl - open license screen; proStatus=\(configurationService.proStatus)") + LOG.info("Openurl - open license screen; proStatus=\(configurationService.proStatus)") let processor = OpenLicenseControllerParser(executor: executor) return processor.parse(url) // Open license controller case (.inAppUrlScheme, .enableAdvancedProtection): - DDLogInfo("(URLSchemeParser) openurl - open advanced protection screen; proStatus=\(configurationService.proStatus)") + LOG.info("Openurl - open advanced protection screen; proStatus=\(configurationService.proStatus)") let processor = OpenAdvancedProtectionParser(executor: executor) return processor.parse(url) diff --git a/AdguardExtension/AdguardApp/Services/AppleSearchAd/AdServicesHelper.swift b/AdguardExtension/AdguardApp/Services/AppleSearchAd/AdServicesHelper.swift index 864c73be7..8b3dcf46c 100644 --- a/AdguardExtension/AdguardApp/Services/AppleSearchAd/AdServicesHelper.swift +++ b/AdguardExtension/AdguardApp/Services/AppleSearchAd/AdServicesHelper.swift @@ -16,11 +16,15 @@ // along with Adguard for iOS. If not, see . // +import SharedAdGuardSDK + protocol AdServicesHelperProtocol { @available(iOS 14.3, *) - func fetchAttributionRecords(completionHandler: @escaping (Result<[String: String], Error>) -> Void) + func fetchAttributionRecords(completionHandler: @escaping (Result<[String: String]>) -> Void) } +private let LOG = LoggerFactory.getLoggerWrapper(AdServicesHelper.self) + /// This object is a helper for `AppleSearchAdsService` and works with AdService framework final class AdServicesHelper: AdServicesHelperProtocol { @@ -40,27 +44,27 @@ final class AdServicesHelper: AdServicesHelperProtocol { // MARK: - Public methods @available(iOS 14.3, *) - func fetchAttributionRecords(completionHandler: @escaping (Result<[String: String], Error>) -> Void) { + func fetchAttributionRecords(completionHandler: @escaping (Result<[String: String]>) -> Void) { do { let attributionToken = try adServicesWrapper.getAttributionToken() httpRequestService.getAttributionRecords(attributionToken) { result in switch result { case .success(let json): if json.isEmpty { - DDLogError("(AdServicesHelper) - fetchAttributionRecords; Search Ads data is missing") - completionHandler(.failure(AppleSearchAdsService.AdsError.missingAttributionData)) + LOG.error("Search Ads data is missing") + completionHandler(.error(AppleSearchAdsService.AdsError.missingAttributionData)) return } completionHandler(.success(json)) case .failure(let error): - DDLogError("(AdServicesHelper) - fetchAttributionRecords; On http request error: \(error)") - completionHandler(.failure(error)) + LOG.error("On http request error: \(error)") + completionHandler(.error(error)) } } } catch { - DDLogError("(AdServicesHelper) - fetchAttributionRecords; Attribution token error occurred: \(error)") - completionHandler(.failure(error)) + LOG.error("Attribution token error occurred: \(error)") + completionHandler(.error(error)) } } } diff --git a/AdguardExtension/AdguardApp/Services/AppleSearchAd/IAdFrameworkHelper.swift b/AdguardExtension/AdguardApp/Services/AppleSearchAd/IAdFrameworkHelper.swift index 24a05a385..529aec920 100644 --- a/AdguardExtension/AdguardApp/Services/AppleSearchAd/IAdFrameworkHelper.swift +++ b/AdguardExtension/AdguardApp/Services/AppleSearchAd/IAdFrameworkHelper.swift @@ -15,11 +15,14 @@ // You should have received a copy of the GNU General Public License // along with Adguard for iOS. If not, see . // +import SharedAdGuardSDK protocol IAdFrameworkHelperProtocol { - func fetchAttributionRecords(completionHandler: @escaping (Result<[String: String], Error>) -> Void) + func fetchAttributionRecords(completionHandler: @escaping (Result<[String: String]>) -> Void) } +private let LOG = LoggerFactory.getLoggerWrapper(IAdFrameworkHelper.self) + /// This object is a helper for `AppleSearchAdsService` and works with iAd framework final class IAdFrameworkHelper: IAdFrameworkHelperProtocol { @@ -35,32 +38,32 @@ final class IAdFrameworkHelper: IAdFrameworkHelperProtocol { // MARK: - Public methods - func fetchAttributionRecords(completionHandler: @escaping (Result<[String: String], Error>) -> Void) { + func fetchAttributionRecords(completionHandler: @escaping (Result<[String: String]>) -> Void) { adClientWrapper.requestAttributionDetails { [weak self] result in switch result { case .success(let details): self?.processAttributionDetails(details, completionHandler: completionHandler) case .failure(let error): - DDLogError("(IAdFrameworkHelper) - fetchAttributionRecords; Search Ads error: \(error)") - completionHandler(.failure(error)) + LOG.error("Search Ads error: \(error)") + completionHandler(.error(error)) return } } } - private func processAttributionDetails(_ attributionDetails: [String: NSObject], completionHandler: @escaping (Result<[String: String], Error>) -> Void) { + private func processAttributionDetails(_ attributionDetails: [String: NSObject], completionHandler: @escaping (Result<[String: String]>) -> Void) { var json = [String: String]() for (version, adDictionary) in attributionDetails { - DDLogInfo("(IAdFrameworkHelper) - processAttributionDetails; Search Ads version: \(version)") + LOG.info("Search Ads version: \(version)") if let attributionInfo = adDictionary as? [String: String] { json = attributionInfo } } if json.isEmpty { - DDLogError("(IAdFrameworkHelper) - processAttributionDetails; Search Ads data is missing") - completionHandler(.failure(AppleSearchAdsService.AdsError.missingAttributionData)) + LOG.error("Search Ads data is missing") + completionHandler(.error(AppleSearchAdsService.AdsError.missingAttributionData)) return } diff --git a/AdguardExtension/AdguardApp/Services/AppleSearchAdsService.swift b/AdguardExtension/AdguardApp/Services/AppleSearchAdsService.swift index aca9dcf4f..28044b495 100644 --- a/AdguardExtension/AdguardApp/Services/AppleSearchAdsService.swift +++ b/AdguardExtension/AdguardApp/Services/AppleSearchAdsService.swift @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with Adguard for iOS. If not, see . // +import SharedAdGuardSDK protocol AppleSearchAdsServiceProtocol { /// Provides attribution records in string JSON format @@ -28,6 +29,8 @@ fileprivate enum UsedFrameworks { case adServices } +private let LOG = LoggerFactory.getLoggerWrapper(AppleSearchAdsService.self) + /// This object is responsible for providing attribution records /// for iAd framework response: /// https://developer.apple.com/documentation/iad/setting_up_apple_search_ads_attribution/ @@ -101,7 +104,7 @@ final class AppleSearchAdsService: AppleSearchAdsServiceProtocol { } private func processResult( - _ result: Result<[String : String], Error>, + _ result: Result<[String : String]>, type: UsedFrameworks, completionHandler: @escaping (_ jsonString: String?) -> Void ) { @@ -109,9 +112,9 @@ final class AppleSearchAdsService: AppleSearchAdsServiceProtocol { switch result { case .success(let json): jsonString = convertJSONtoParameterString(json: json, type: type) - case .failure(let error): + case .error(let error): jsonString = nil - DDLogError("(AppleSearchAdsService) - processResult; Error occurred while receiving attribution records for framework = \(type); Error: \(error)") + LOG.error("Error occurred while receiving attribution records for framework = \(type); Error: \(error)") } completionQueue.async { completionHandler(jsonString) } } diff --git a/AdguardExtension/AdguardApp/Services/DefaultDnsFilterInstaller.swift b/AdguardExtension/AdguardApp/Services/DefaultDnsFilterInstaller.swift index 213cd5022..6979e2f68 100644 --- a/AdguardExtension/AdguardApp/Services/DefaultDnsFilterInstaller.swift +++ b/AdguardExtension/AdguardApp/Services/DefaultDnsFilterInstaller.swift @@ -17,11 +17,14 @@ // import DnsAdGuardSDK +import SharedAdGuardSDK protocol DefaultDnsFilterInstallerProtocol: AnyObject { func installDefaultDnsFilterIfNeeded() } +private let LOG = LoggerFactory.getLoggerWrapper(DefaultDnsFilterInstaller.self) + /// This object is responsible for installing default DNS filter if it wasn't installed yet final class DefaultDnsFilterInstaller: DefaultDnsFilterInstallerProtocol { @@ -49,10 +52,10 @@ final class DefaultDnsFilterInstaller: DefaultDnsFilterInstallerProtocol { dnsProtection.addFilter(withName: "AdGuard DNS filter", url: defaultFilterUrl, isEnabled: false) { [weak resources] error in if let error = error { - DDLogError("(DefaultDnsFilterInstaller) - installDefaultDnsFilterIfNeeded; Failed to install default DNS filter with error: \(error)") + LOG.error("Failed to install default DNS filter with error: \(error)") return } - DDLogError("(DefaultDnsFilterInstaller) - installDefaultDnsFilterIfNeeded; Installed default DNS filter") + LOG.error("Installed default DNS filter") resources?.defaultDnsFilterWasInstalled = true } } diff --git a/AdguardExtension/AdguardApp/Services/FileShareHelper.swift b/AdguardExtension/AdguardApp/Services/FileShareHelper.swift index 903d5410f..72ca8c455 100644 --- a/AdguardExtension/AdguardApp/Services/FileShareHelper.swift +++ b/AdguardExtension/AdguardApp/Services/FileShareHelper.swift @@ -17,6 +17,7 @@ // import Foundation +import SharedAdGuardSDK /// FileShareHelper is reponsible for exporting and importing files to Files App protocol FileShareHelperProtocol { @@ -24,12 +25,14 @@ protocol FileShareHelperProtocol { func exportFile(for vc: UIViewController, filename: String, text: String) /// imports text from Files App. Returns @text of imported file as a string in callback - func importFile(for vc: UIViewController, _ completion: @escaping (Result) -> Void) + func importFile(for vc: UIViewController, _ completion: @escaping (Result) -> Void) } +private let LOG = LoggerFactory.getLoggerWrapper(FileShareHelper.self) + final class FileShareHelper: NSObject, UIDocumentPickerDelegate, FileShareHelperProtocol { - private var importCompletion: ((Result) -> Void)? + private var importCompletion: ((Result) -> Void)? func exportFile(for vc: UIViewController, filename: String, text: String) { let tmp = FileManager.default.temporaryDirectory.appendingPathComponent(filename) @@ -47,11 +50,11 @@ final class FileShareHelper: NSObject, UIDocumentPickerDelegate, FileShareHelper vc.present(activityVC, animated: true, completion: nil) } catch { - DDLogError("(FileShareHelper) - exportFile; Error: \(error)") + LOG.error("exportFile; Error: \(error)") } } - func importFile(for vc: UIViewController, _ completion: @escaping (Result) -> Void) { + func importFile(for vc: UIViewController, _ completion: @escaping (Result) -> Void) { let controller = UIDocumentPickerViewController(documentTypes: ["public.text"], in: .open) controller.popoverPresentationController?.sourceView = vc.view controller.popoverPresentationController?.sourceRect = vc.view.frame @@ -74,8 +77,8 @@ final class FileShareHelper: NSObject, UIDocumentPickerDelegate, FileShareHelper importCompletion?(.success(text)) } catch { - DDLogError("(FileShareHelper) - documentPicker; Error: \(error)") - importCompletion?(.failure(error)) + LOG.error("documentPicker; Error: \(error)") + importCompletion?(.error(error)) } } } diff --git a/AdguardExtension/AdguardApp/Services/ImportSettings/ImportDNSSettingsHelper.swift b/AdguardExtension/AdguardApp/Services/ImportSettings/ImportDNSSettingsHelper.swift index c3b723d67..35923c14d 100644 --- a/AdguardExtension/AdguardApp/Services/ImportSettings/ImportDNSSettingsHelper.swift +++ b/AdguardExtension/AdguardApp/Services/ImportSettings/ImportDNSSettingsHelper.swift @@ -31,6 +31,8 @@ protocol ImportDNSSettingsHelperProtocol { func importDnsFilters(_ filtersContainer: ImportSettingsService.FiltersImportContainer, override: Bool, completion: @escaping ([ImportSettings.FilterSettings]) -> Void) } +private let LOG = LoggerFactory.getLoggerWrapper(ImportDNSSettingsHelper.self) + /// This object is responsible for importing DNS protection settings final class ImportDNSSettingsHelper: ImportDNSSettingsHelperProtocol { @@ -68,10 +70,10 @@ final class ImportDNSSettingsHelper: ImportDNSSettingsHelperProtocol { if let provider = dnsProvidersManager.allProviders.first(where: { $0.dnsServers.contains(where: { $0.id == serverId }) }) { do { try dnsProvidersManager.selectProvider(withId: provider.providerId, serverId: serverId) - DDLogInfo("(ImportDNSSettingsHelper) - importDnsServer; Server with id = \(serverId) and provider = \(provider.name) were successfully selected") + LOG.info("Server with id = \(serverId) and provider = \(provider.name) were successfully selected") return true } catch { - DDLogError("(ImportDNSSettingsHelper) - importDnsServer; Error occurred while selecting server with id = \(serverId) and provider = \(provider.name)") + LOG.error("Error occurred while selecting server with id = \(serverId) and provider = \(provider.name)") return false } } @@ -82,7 +84,7 @@ final class ImportDNSSettingsHelper: ImportDNSSettingsHelperProtocol { func importDnsFilters(_ filtersContainer: ImportSettingsService.FiltersImportContainer, override: Bool, completion: @escaping ([ImportSettings.FilterSettings]) -> Void) { workingQueue.async { [weak self] in guard let self = self else { - DDLogError("(ImportDNSSettingsHelper) - importDnsFilters; Missing self") + LOG.error("Missing self") DispatchQueue.main.async { completion([]) } return } @@ -129,34 +131,34 @@ final class ImportDNSSettingsHelper: ImportDNSSettingsHelperProtocol { private func addDnsFilter(_ filter: ImportSettings.FilterSettings, completion: @escaping (_ success: Bool) -> Void) { guard let url = URL(string: filter.url) else { - DDLogError("(ImportDNSSettingsHelper) - subscribeDnsFilter; Invalid URL string: \(filter.url)") + LOG.error("Invalid URL string: \(filter.url)") completion(false) return } dnsProtection.addFilter(withName: filter.name, url: url, isEnabled: true) { error in if let error = error { - DDLogError("(ImportDNSSettingsHelper) - subscribeDnsFilter; Error occurred while trying to add DNS filter with url = \(url); Error: \(error)") + LOG.error("Error occurred while trying to add DNS filter with url = \(url); Error: \(error)") completion(false) return } - DDLogInfo("(ImportDNSSettingsHelper) - subscribeDnsFilter; DNS Filter with url = \(url) successfully added") + LOG.info("DNS Filter with url = \(url) successfully added") completion(true) } } private func setDnsFilter(_ filter: ImportSettings.FilterSettings) -> Bool { guard let id = dnsProtection.filters.first(where: { $0.filterDownloadPage == filter.url })?.filterId else { - DDLogError("(ImportDNSSettingsHelper) - setDnsFilter; Dns filter with url=\(filter.url) not exists") + LOG.error("Dns filter with url=\(filter.url) not exists") return false } do { try dnsProtection.setFilter(withId: id, to: true) - DDLogInfo("(ImportDNSSettingsHelper) - setDnsFilter; Successfully enable dns filter with url=\(filter.url)") + LOG.info("Successfully enable dns filter with url=\(filter.url)") return true } catch { - DDLogError("(ImportDNSSettingsHelper) - setDnsFilter; Dns filter with url=\(filter.url) were not enabled: Error: \(error)") + LOG.error("Dns filter with url=\(filter.url) were not enabled: Error: \(error)") return false } } @@ -165,9 +167,9 @@ final class ImportDNSSettingsHelper: ImportDNSSettingsHelperProtocol { dnsProtection.filters.forEach { do { try dnsProtection.removeFilter(withId: $0.filterId) - DDLogInfo("(ImportDNSSettingsHelper) - removeAllDnsFilters; DNS filter with id = \($0.filterId) were removed") + LOG.info("DNS filter with id = \($0.filterId) were removed") } catch { - DDLogError("(ImportDNSSettingsHelper) - removeAllDnsFilters; Error occurred while removing filter with id = \($0.filterId)") + LOG.error("Error occurred while removing filter with id = \($0.filterId)") } } } diff --git a/AdguardExtension/AdguardApp/Services/ImportSettings/ImportSafariProtectionSettingsHelper.swift b/AdguardExtension/AdguardApp/Services/ImportSettings/ImportSafariProtectionSettingsHelper.swift index 9af3ee0f0..40daf317a 100644 --- a/AdguardExtension/AdguardApp/Services/ImportSettings/ImportSafariProtectionSettingsHelper.swift +++ b/AdguardExtension/AdguardApp/Services/ImportSettings/ImportSafariProtectionSettingsHelper.swift @@ -30,6 +30,8 @@ protocol ImportSafariProtectionSettingsHelperProtocol { func importCustomSafariFilters(_ filtersContainer: ImportSettingsService.FiltersImportContainer, override: Bool, completion: @escaping ([ImportSettings.FilterSettings]) -> Void) } +private let LOG = LoggerFactory.getLoggerWrapper(ImportSafariProtectionSettingsHelper.self) + /// This object is responsible for importing Safari protection settings final class ImportSafariProtectionSettingsHelper: ImportSafariProtectionSettingsHelperProtocol { @@ -78,7 +80,7 @@ final class ImportSafariProtectionSettingsHelper: ImportSafariProtectionSettings func importCustomSafariFilters(_ filtersContainer: ImportSettingsService.FiltersImportContainer, override: Bool, completion: @escaping ([ImportSettings.FilterSettings]) -> Void) { workingQueue.async { [weak self] in guard let self = self else { - DDLogError("(ImportSafariProtectionSettingsHelper) - importCustomSafariFilters; Missing self") + LOG.error("Missing self") DispatchQueue.main.async { completion([]) } return } @@ -132,7 +134,7 @@ final class ImportSafariProtectionSettingsHelper: ImportSafariProtectionSettings private func addCustomFilter(_ filter: ImportSettings.FilterSettings, completion: @escaping (_ success: Bool) -> Void) { guard let url = URL(string: filter.url) else { - DDLogError("(ImportSafariProtectionSettingsHelper) - addCustomFilter; Incorrect URL string = \(filter.url)") + LOG.error("Incorrect URL string = \(filter.url)") self.completionQueue.async { completion(false) } return } @@ -141,17 +143,17 @@ final class ImportSafariProtectionSettingsHelper: ImportSafariProtectionSettings let meta = try parser.getMetaFrom(url: url, for: .safari) safariProtection.add(customFilter: meta, enabled: true) { error in if let error = error { - DDLogError("(ImportSafariProtectionSettingsHelper) - addCustomFilter; Error occurred while adding new custom filter with url = \(url); Error: \(error)") + LOG.error("Error occurred while adding new custom filter with url = \(url); Error: \(error)") self.completionQueue.async { completion(false) } return } - DDLogInfo("(ImportSafariProtectionSettingsHelper) - addCustomFilter; Successfully add new custom filter with url = \(url)") + LOG.info("Successfully add new custom filter with url = \(url)") self.completionQueue.async { completion(true) } } } catch { - DDLogError("(ImportSafariProtectionSettingsHelper) - addCustomFilter; Error occurred while trying to add filter with url=\(url); Error: \(error)") + LOG.error("Error occurred while trying to add filter with url=\(url); Error: \(error)") self.completionQueue.async { completion(false) } } } @@ -177,10 +179,10 @@ final class ImportSafariProtectionSettingsHelper: ImportSafariProtectionSettings private func setFilter(_ filter: SafariGroup.Filter, enabled: Bool) -> ImportSettings.ImportSettingStatus { do { try safariProtection.setFilter(withId: filter.filterId, groupId: filter.group.groupId, enabled: enabled) - DDLogInfo("(ImportSafariProtectionSettingsHelper) - setFilter; Successfully set enable to \(enabled) for filter with id = \(filter.filterId) for group id = \(filter.group.groupId)") + LOG.info("Successfully set enable to \(enabled) for filter with id = \(filter.filterId) for group id = \(filter.group.groupId)") return .successful } catch { - DDLogError("(ImportSafariProtectionSettingsHelper) - setFilter; Error occurred while setting enable to \(enabled) for filter with id = \(filter.filterId) for group id = \(filter.group.groupId)") + LOG.error("Error occurred while setting enable to \(enabled) for filter with id = \(filter.filterId) for group id = \(filter.group.groupId)") return .unsuccessful } } @@ -189,9 +191,9 @@ final class ImportSafariProtectionSettingsHelper: ImportSafariProtectionSettings groupsToEnable.forEach { do { try safariProtection.setGroup(groupType: $0, enabled: true) - DDLogInfo("(ImportSafariProtectionSettingsHelper) - enableGroups; Group \($0) was enabled") + LOG.info("Group \($0) was enabled") } catch { - DDLogError("(ImportSafariProtectionSettingsHelper) - enableGroups; Error occurred while enabling group \($0); Error: \(error)") + LOG.error("Error occurred while enabling group \($0); Error: \(error)") } } } @@ -229,17 +231,17 @@ final class ImportSafariProtectionSettingsHelper: ImportSafariProtectionSettings private func disableGroupAndAllFilters(for group: SafariGroup) { do { try safariProtection.setGroup(groupType: group.groupType, enabled: false) - DDLogInfo("(ImportSafariProtectionSettingsHelper) - disableGroupAndAllFilters; Group = \(group.groupType) was disabled") + LOG.info("Group = \(group.groupType) was disabled") } catch { - DDLogError("(ImportSafariProtectionSettingsHelper) - disableGroupAndAllFilters; Error occurred while disabling group = \(group.groupType); Error: \(error)") + LOG.error("Error occurred while disabling group = \(group.groupType); Error: \(error)") } group.filters.forEach { filter in do { try safariProtection.setFilter(withId: filter.filterId, groupId: filter.group.groupId, enabled: false) - DDLogInfo("(ImportSafariProtectionSettingsHelper) - disableGroupAndAllFilters; Filter with id = \(filter.filterId) was disabled") + LOG.info("Filter with id = \(filter.filterId) was disabled") } catch { - DDLogError("(ImportSafariProtectionSettingsHelper) - disableGroupAndAllFilters; Error occurred while disabling filter with id = \(filter.filterId); Error: \(error)") + LOG.error("Error occurred while disabling filter with id = \(filter.filterId); Error: \(error)") } } } @@ -248,9 +250,9 @@ final class ImportSafariProtectionSettingsHelper: ImportSafariProtectionSettings group.filters.forEach { do { try safariProtection.deleteCustomFilter(withId: $0.filterId) - DDLogInfo("(ImportSafariProtectionSettingsHelper) - deleteFilters; Successfully delete filter with id = \($0.filterId)") + LOG.info("Successfully delete filter with id = \($0.filterId)") } catch { - DDLogError("(ImportSafariProtectionSettingsHelper) - deleteFilters; Error occurred while deleting filter with id = \($0.filterId); Error: \(error)") + LOG.error("Error occurred while deleting filter with id = \($0.filterId); Error: \(error)") } } } @@ -259,16 +261,16 @@ final class ImportSafariProtectionSettingsHelper: ImportSafariProtectionSettings guard let customGroup = safariProtection.groups.first(where: { $0.groupType == .custom }), let customSafariFilter = customGroup.filters.first(where: { $0.filterDownloadPage == filter.url }) else { - DDLogError("(ImportSafariProtectionSettingsHelper) - setCustomSafariFilter; Custom safari filter with url=\(filter.url) not exists") + LOG.error("Custom safari filter with url=\(filter.url) not exists") return .unsuccessful } do { try safariProtection.setFilter(withId: customSafariFilter.filterId, groupId: SafariGroup.GroupType.custom.id, enabled: true) - DDLogInfo("(ImportSafariProtectionSettingsHelper) - setCustomSafariFilter; Successfully enable custom safari filter with url=\(filter.url)") + LOG.info("Successfully enable custom safari filter with url=\(filter.url)") return .successful } catch { - DDLogError("(ImportSafariProtectionSettingsHelper) - setCustomSafariFilter; Custom safari filter with url=\(filter.url) were not enabled: Error: \(error)") + LOG.error("Custom safari filter with url=\(filter.url) were not enabled: Error: \(error)") return .unsuccessful } } diff --git a/AdguardExtension/AdguardApp/Services/ImportSettings/ImportSettingsService.swift b/AdguardExtension/AdguardApp/Services/ImportSettings/ImportSettingsService.swift index 2e7c4a248..ea8200a2c 100644 --- a/AdguardExtension/AdguardApp/Services/ImportSettings/ImportSettingsService.swift +++ b/AdguardExtension/AdguardApp/Services/ImportSettings/ImportSettingsService.swift @@ -26,6 +26,8 @@ protocol ImportSettingsServiceProtocol { func applySettings(_ settings: ImportSettings, completion: @escaping (ImportSettings) -> Void) } +private let LOG = LoggerFactory.getLoggerWrapper(ImportSettingsService.self) + /// This class is responsible for applying the imported settings final class ImportSettingsService: ImportSettingsServiceProtocol { @@ -236,17 +238,17 @@ final class ImportSettingsService: ImportSettingsServiceProtocol { safariProtection.updateFiltersMetaAndLocalizations(true) { result in switch result { case .success(_): - DDLogInfo("(ImportSettingsService) - updateMetaAndReloadCB; Successfully updates filters meta and localizations") + LOG.info("Successfully updates filters meta and localizations") case .error(let error): - DDLogError("(ImportSettingsService) - updateMetaAndReloadCB; Error occurred while updating filters meta and localizations; Error: \(error)") + LOG.error("Error occurred while updating filters meta and localizations; Error: \(error)") } group.leave() } onCbReloaded: { error in if let error = error { - DDLogError("(ImportSettingsService) - updateMetaAndReloadCB; Error occurred while reloading content blockers; Error: \(error)") + LOG.error("Error occurred while reloading content blockers; Error: \(error)") return } - DDLogInfo("(ImportSettingsService) - updateMetaAndReloadCB; Content blockers successfully reloaded") + LOG.info("Content blockers successfully reloaded") } group.wait() } diff --git a/AdguardExtension/AdguardApp/Services/KeychainService.swift b/AdguardExtension/AdguardApp/Services/KeychainService.swift index bd9a816bd..daa882888 100644 --- a/AdguardExtension/AdguardApp/Services/KeychainService.swift +++ b/AdguardExtension/AdguardApp/Services/KeychainService.swift @@ -17,6 +17,7 @@ // import Foundation +import SharedAdGuardSDK protocol KeychainServiceProtocol { @@ -32,6 +33,8 @@ protocol KeychainServiceProtocol { func reset() } +private let LOG = LoggerFactory.getLoggerWrapper(KeychainService.self) + class KeychainService : KeychainServiceProtocol { let appIdService = "deviceInfo" @@ -48,7 +51,7 @@ class KeychainService : KeychainServiceProtocol { get { let (storedId, notFound) = getStoredAppId() - DDLogInfo("(KeychainService) get appId. strored: \(storedId ?? "nil")") + LOG.info("Get appId. Stored: \(storedId ?? "nil")") if storedId != nil { return storedId @@ -63,7 +66,7 @@ class KeychainService : KeychainServiceProtocol { let newAppId = generateAppId() - DDLogInfo("(KeychainService) generate new app id: \(newAppId)") + LOG.info("Generate new app id: \(newAppId)") if !save(appId: newAppId) { return nil } @@ -235,22 +238,22 @@ class KeychainService : KeychainServiceProtocol { kSecReturnAttributes as String: true, kSecReturnData as String: true] - DDLogInfo("(KeychainService) getStoredAppId") + LOG.info("getStoredAppId") var attributes: CFTypeRef? let status = SecItemCopyMatching(query as CFDictionary, &attributes) if status == errSecItemNotFound { - DDLogInfo("(KeychainService) getStoredAppId error - not found") + LOG.info("getStoredAppId error - not found") return (nil, true) } if status != errSecSuccess { - DDLogError("(KeychainService) getStoredAppId error. Status: \(status)") + LOG.error("getStoredAppId error. Status: \(status)") return (nil, false) } guard let resultArr = attributes as? [[String: Any]] else { - DDLogError("(KeychainService) getStoredAppId error. Unknown result format") + LOG.error("getStoredAppId error. Unknown result format") return (nil, false) } @@ -258,21 +261,21 @@ class KeychainService : KeychainServiceProtocol { guard let key = resultDict[kSecAttrAccount as String] as? String, let value = resultDict[kSecValueData as String] else { - DDLogError("(KeychainService) getStoredAppId error. Unknown result format 2") + LOG.error("getStoredAppId error. Unknown result format 2") continue } guard let valueString = String(data: value as! Data, encoding: .utf8) else { - DDLogError("(KeychainService) getStoredAppId error. Unknown result format 3") + LOG.error("getStoredAppId error. Unknown result format 3") continue } if key != appIdKey { - DDLogError("(KeychainService) getStoredAppId error. appIdKey does not match") + LOG.error("getStoredAppId error. appIdKey does not match") continue } - DDLogInfo("(KeychainService) getStoredAppId - success") + LOG.info("getStoredAppId - success") return (valueString, false) } @@ -298,14 +301,14 @@ class KeychainService : KeychainServiceProtocol { var result: CFTypeRef? let status = SecItemAdd(query as CFDictionary, &result) - DDLogInfo("(KeychainService) save app id status: \(status)") + LOG.info("Save app id status: \(status)") return status == errSecSuccess } internal func deleteAppId()-> Bool { - DDLogInfo("(KeychainService) deleteAppId") + LOG.info("deleteAppId") // read app id from keychain @@ -318,12 +321,12 @@ class KeychainService : KeychainServiceProtocol { var attributes: CFTypeRef? let status = SecItemCopyMatching(query as CFDictionary, &attributes) if(status != errSecSuccess) { - DDLogError("(KeychainService) deleteAppId read error. Status: \(status) ") + LOG.error("deleteAppId read error. Status: \(status) ") return false } guard let records = attributes as? [[String: Any]] else { - DDLogError("(KeychainService) deleteAppId read error. There are no records") + LOG.error("deleteAppId read error. There are no records") return false } @@ -339,11 +342,11 @@ class KeychainService : KeychainServiceProtocol { let deleteStatus = SecItemDelete(deleteQuery as CFDictionary) if deleteStatus != errSecSuccess { - DDLogError("(KeychainService) deleteAppId delete error. Status: \(deleteStatus) ") + LOG.error("deleteAppId delete error. Status: \(deleteStatus) ") return false } - DDLogInfo("(KeychainService) deleteAppId - success") + LOG.info("deleteAppId - success") } return true diff --git a/AdguardExtension/AdguardApp/Services/LoginResponseParser.swift b/AdguardExtension/AdguardApp/Services/LoginResponseParser.swift index 16e8b1551..76b88bc13 100644 --- a/AdguardExtension/AdguardApp/Services/LoginResponseParser.swift +++ b/AdguardExtension/AdguardApp/Services/LoginResponseParser.swift @@ -17,6 +17,7 @@ // import Foundation +import SharedAdGuardSDK protocol LoginResponseParserProtocol { func processLoginResponse(data: Data)->(loggedIn: Bool, premium: Bool,expirationDate: Date?, licenseKey: String?, NSError?) @@ -26,6 +27,7 @@ protocol LoginResponseParserProtocol { func processOauthTokenResponse(data: Data)->(accessToken: String?, expirationDate: Date?, error: NSError?) } +private let LOG = LoggerFactory.getLoggerWrapper(LoginResponseParser.self) class LoginResponseParser: LoginResponseParserProtocol { @@ -83,7 +85,7 @@ class LoginResponseParser: LoginResponseParserProtocol { } catch { let responseString = String(data: data, encoding: .utf8) - DDLogError("(LoginResponseParser) error. Wrong json: \(responseString ?? "")") + LOG.error("Error. Wrong json: \(responseString ?? "")") let error = NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: nil) return (false, false, nil, nil, error) } @@ -98,7 +100,7 @@ class LoginResponseParser: LoginResponseParserProtocol { } catch { let responseString = String(data: data, encoding: .utf8) - DDLogError("(LoginResponseParser) error. Wrong json: \(responseString ?? "")") + LOG.error("Error. Wrong json: \(responseString ?? "")") let error = NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: nil) return (false, nil, error) } @@ -112,7 +114,7 @@ class LoginResponseParser: LoginResponseParserProtocol { } catch { let responseString = String(data: data, encoding: .utf8) - DDLogError("(LoginResponseParser) error. Wrong json: \(responseString ?? "")") + LOG.error("Error. Wrong json: \(responseString ?? "")") let error = NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: nil) return (nil, nil, error) } @@ -124,7 +126,7 @@ class LoginResponseParser: LoginResponseParserProtocol { guard let status = json[LOGIN_AUTH_STATUS_PARAM] as? String else { let error = NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: nil) - DDLogError("(LoginService) login error - json does not contain status param." ) + LOG.error("Login error - json does not contain status param." ) return (false, false, nil, nil, error) } @@ -150,7 +152,7 @@ class LoginResponseParser: LoginResponseParserProtocol { if status == AUTH_BAD_CREDINTIALS { - DDLogInfo("(LoginService) login error - bad credintials" ) + LOG.info("Login error - bad credintials" ) let error = NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginBadCredentials, userInfo: nil) return (false, false, nil, nil, error) } @@ -170,14 +172,14 @@ class LoginResponseParser: LoginResponseParserProtocol { private func processStatusResponseJson(json: [String: Any]) -> (premium: Bool,expirationDate: Date?, NSError?) { guard let status = json[STATUS_RESPONSE_STATUS_PARAM] as? String else { - DDLogInfo("(LoginService) processStatusResponseJson error - json does not contain status" ) + LOG.info("processStatusResponseJson error - json does not contain status" ) let error = NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginBadCredentials, userInfo: nil) return (false, nil, error) } if status == STATUS_RESPONSE_STATUS_ERROR { let licenseKeyStatus = (json["licenseKeyStatus"] as? String) ?? "" - DDLogInfo("(LoginService) processStatusResponseJson error - status = ERROR licenseKeyStatus: \(licenseKeyStatus)") + LOG.info("processStatusResponseJson error - status = ERROR licenseKeyStatus: \(licenseKeyStatus)") var error = NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: nil) diff --git a/AdguardExtension/AdguardApp/Services/LoginService.swift b/AdguardExtension/AdguardApp/Services/LoginService.swift index 67aa38793..a5a473658 100644 --- a/AdguardExtension/AdguardApp/Services/LoginService.swift +++ b/AdguardExtension/AdguardApp/Services/LoginService.swift @@ -18,6 +18,7 @@ import Foundation import UIKit.UIDevice +import SharedAdGuardSDK /** LoginService - this service is responsible for working with adguard logins and licenses @@ -53,6 +54,8 @@ protocol LoginServiceProtocol { func reset(completion:@escaping ()->Void ) } +private let LOG = LoggerFactory.getLoggerWrapper(LoginService.self) + final class LoginService: LoginServiceProtocol { // MARK: - Internal variables @@ -200,7 +203,7 @@ final class LoginService: LoginServiceProtocol { } func getOauthToken(username: String, password: String, twoFactorToken: String?, callback: @escaping (_ token: String?, _ error: NSError?)->Void) { - DDLogInfo("(LoginService) getOauthToken ") + LOG.info("getOauthToken") var params = ["username" : username, "password" : password, @@ -215,7 +218,7 @@ final class LoginService: LoginServiceProtocol { guard let url = URL(string: OAUTH_TOKEN_URL) else { callback(nil, NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: nil)) - DDLogError("(LoginService) getOauthToken error. Can not make URL from String \(OAUTH_TOKEN_URL)") + LOG.error("getOauthToken error. Can not make URL from String \(OAUTH_TOKEN_URL)") return } @@ -224,18 +227,18 @@ final class LoginService: LoginServiceProtocol { network.data(with: request) { [weak self] (dataOrNil, response, error) in guard let sSelf = self else { return } guard error == nil else { - DDLogError("(LoginService) getOauthToken - got error \(error!.localizedDescription)") + LOG.error("getOauthToken - got error \(error!.localizedDescription)") callback(nil, error as NSError?) return } guard let data = dataOrNil else { - DDLogError("(LoginService) getOauthToken - response data is nil") + LOG.error("getOauthToken - response data is nil") callback(nil, NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: nil)) return } - DDLogInfo("(LoginService) getOauthToken get response") + LOG.info("getOauthToken get response") let result = sSelf.loginResponseParser.processOauthTokenResponse(data: data) @@ -278,12 +281,12 @@ final class LoginService: LoginServiceProtocol { private func loginInternal(accessToken: String, attributionRecords: String?, callback: @escaping (NSError?) -> Void) { guard let appId = keychain.appId else { - DDLogError("(LoginService) loginInternal error - can not obtain appId)") + LOG.error("loginInternal error - can not obtain appId)") callback(NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: [:])) return } - DDLogInfo("(LoginService) - loginInternal. Login with access_token") + LOG.info("loginInternal. Login with access_token") let params = [LOGIN_APP_NAME_PARAM: LoginService.APP_NAME_VALUE, LOGIN_APP_ID_PARAM: appId, @@ -291,7 +294,7 @@ final class LoginService: LoginServiceProtocol { guard let url = URL(string: AUTH_TOKEN_URL) else { callback(NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: nil)) - DDLogError("(LoginService) login error. Can not make URL from String \(AUTH_TOKEN_URL)") + LOG.error("login error. Can not make URL from String \(AUTH_TOKEN_URL)") return } @@ -303,23 +306,23 @@ final class LoginService: LoginServiceProtocol { guard let sSelf = self else { return } guard error == nil else { - DDLogError("(LoginService) loginInternal - got error \(error!.localizedDescription)") + LOG.error("loginInternal - got error \(error!.localizedDescription)") callback(error! as NSError) return } guard let data = dataOrNil else{ - DDLogError("(LoginService) loginInternal - got empty response") + LOG.error("loginInternal - got empty response") callback(NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: nil)) return } let (loggedIn, premium, expirationDate, licenseKey, error) = sSelf.loginResponseParser.processLoginResponse(data: data) - DDLogInfo("(LoginService) loginInternal - processLoginResponse: loggedIn - \(loggedIn ? "true" : "false") premium = \(premium) expirationDate = " + (expirationDate == nil ? "nil" : expirationDate!.description)) + LOG.info("loginInternal - processLoginResponse: loggedIn - \(loggedIn ? "true" : "false") premium = \(premium) expirationDate = " + (expirationDate == nil ? "nil" : expirationDate!.description)) if error != nil { - DDLogError("(LoginService) loginInternal - processLoginResponse error: \(error!.localizedDescription)") + LOG.error("loginInternal - processLoginResponse error: \(error!.localizedDescription)") callback(error!) return } @@ -330,10 +333,10 @@ final class LoginService: LoginServiceProtocol { private func requestStatus(licenseKey: String?, attributionRecords: String?, callback: @escaping (NSError?)->Void ) { - DDLogInfo("(LoginService) requestStatus " + (licenseKey == nil ? "without license key" : "with license key")) + LOG.info("requestStatus " + (licenseKey == nil ? "without license key" : "with license key")) guard let appId = keychain.appId else { - DDLogError("(LoginService) loginInternal error - can not obtain appId)") + LOG.error("loginInternal error - can not obtain appId)") callback(NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: [:])) return } @@ -349,13 +352,13 @@ final class LoginService: LoginServiceProtocol { } if let attributionRecords = attributionRecords { - DDLogInfo("(LoginService) - requestStatus; Attribution records added as parameter for request status") + LOG.info("requestStatus; Attribution records added as parameter for request status") params[STATUS_ATTRIBUTION_RECORDS_PARAM] = attributionRecords } guard let url = URL(string: STATUS_URL) else { callback(NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: nil)) - DDLogError("(LoginService) checkStatus error. Can not make URL from String \(STATUS_URL)") + LOG.error("checkStatus error. Can not make URL from String \(STATUS_URL)") return } @@ -365,24 +368,24 @@ final class LoginService: LoginServiceProtocol { guard let sSelf = self else { return } guard error == nil else { - DDLogError("(LoginService) checkStatus - got error \(error!.localizedDescription)") + LOG.error("checkStatus - got error \(error!.localizedDescription)") callback(error! as NSError) return } guard let data = dataOrNil else { - DDLogError("(LoginService) checkStatus - got empty response") + LOG.error("checkStatus - got empty response") callback(NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: nil)) return } let (premium, expirationDate, error) = sSelf.loginResponseParser.processStatusResponse(data: data) - DDLogInfo("(LoginService) checkStatus - processStatusResponse: premium = \(premium) " + (expirationDate == nil ? "" : "expirationDate = \(expirationDate!)")) + LOG.info("checkStatus - processStatusResponse: premium = \(premium) " + (expirationDate == nil ? "" : "expirationDate = \(expirationDate!)")) if error != nil { - DDLogError("(LoginService) checkStatus - processStatusResponse error: \(error!.localizedDescription)") + LOG.error("checkStatus - processStatusResponse error: \(error!.localizedDescription)") callback(error!) return } @@ -397,10 +400,10 @@ final class LoginService: LoginServiceProtocol { private func resetLicense(callback: @escaping (NSError?)->Void) { - DDLogInfo("(LoginService) resetLicense") + LOG.info("resetLicense") guard let appId = keychain.appId else { - DDLogError("(LoginService) loginInternal error - can not obtain appId)") + LOG.error("loginInternal error - can not obtain appId)") callback(NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: [:])) return } @@ -413,7 +416,7 @@ final class LoginService: LoginServiceProtocol { guard let url = URL(string: RESET_LICENSE_URL) else { callback(NSError(domain: LoginService.loginErrorDomain, code: LoginService.loginError, userInfo: nil)) - DDLogError("(LoginService) checkStatus error. Can not make URL from String \(RESET_LICENSE_URL)") + LOG.error("checkStatus error. Can not make URL from String \(RESET_LICENSE_URL)") return } @@ -423,12 +426,12 @@ final class LoginService: LoginServiceProtocol { network.data(with: request) { (dataOrNil, response, error) in guard error == nil else { - DDLogError("(LoginService) resetLicense - got error \(error!.localizedDescription)") + LOG.error("resetLicense - got error \(error!.localizedDescription)") callback(error! as NSError) return } - DDLogInfo("(LoginService) resetLicense succeeded") + LOG.info("resetLicense succeeded") callback(nil) } @@ -446,7 +449,7 @@ final class LoginService: LoginServiceProtocol { timer = Timer(fire: time, interval: 0, repeats: false) { [weak self] (timer) in guard let sSelf = self else { return } - DDLogInfo("(LoginService) expiration timer fired") + LOG.info("Expiration timer fired") if let callback = sSelf.activeChanged { callback() diff --git a/AdguardExtension/AdguardApp/Services/Migrations/MigrationService.swift b/AdguardExtension/AdguardApp/Services/Migrations/MigrationService.swift index 67f78e8e1..ed65c2b5a 100644 --- a/AdguardExtension/AdguardApp/Services/Migrations/MigrationService.swift +++ b/AdguardExtension/AdguardApp/Services/Migrations/MigrationService.swift @@ -18,11 +18,14 @@ import SafariAdGuardSDK import DnsAdGuardSDK +import SharedAdGuardSDK protocol MigrationServiceProtocol { func migrateIfNeeded() } +private let LOG = LoggerFactory.getLoggerWrapper(MigrationService.self) + /// This object is responsible for running migration code /// It has a knowledge of previous and current product versions /// And runs migrations according to these versions @@ -74,7 +77,7 @@ final class MigrationService: MigrationServiceProtocol { } private func minorAndPatchMigration() { - DDLogInfo("(MigrationService) - minorAndPatchMigration") + LOG.info("minorAndPatchMigration") /* There was a migration here but it is removed now. @@ -95,7 +98,7 @@ final class MigrationService: MigrationServiceProtocol { So, we've decided just to reset all the settings to default for users that had a version before 4.1. */ if versionProvider.isLastVersionLessThan4_1 { - DDLogInfo("(MigrationService) - reset the app to default state") + LOG.info("Reset the app to default state") settingsResetService.resetAllSettings(sync: true, fromUI: false, resetLicense: false) // For older versions after resetting settings mark it as a "first run" to conduct necessary init. resources.firstRun = true @@ -112,7 +115,7 @@ final class MigrationService: MigrationServiceProtocol { So we need to migrate this data respectively */ if versionProvider.isMigrationFrom4_1To4_3Needed { - DDLogInfo("(MigrationService) - app migration to 4.3 started") + LOG.info("App migration to 4.3 started") let oldFilesMigration = SDKMigrationOldFilesHelper( oldFilesContainerUrl: resources.sharedResuorcesURL(), @@ -135,22 +138,22 @@ final class MigrationService: MigrationServiceProtocol { try sdkMigrationHelper.migrate() // Reloads Tunnel if it is active to apply migrated DNS settings dnsConfigAssistant.applyDnsPreferences(for: .modifiedDnsSettings, completion: nil) - DDLogInfo("(MigrationService) - Successfully migrated old data to SDK") + LOG.info("Successfully migrated old data to SDK") } catch { - DDLogError("(MigrationService) - Failed to migrate old data to SDK; Error: \(error)") + LOG.error("Failed to migrate old data to SDK; Error: \(error)") } } if versionProvider.isMigrationFrom4_3_0To4_3_1Needed { - DDLogInfo("(MigrationService) - Starting migrate rules from 4.3.0 to 4.3.1") + LOG.info("Starting migrate rules from 4.3.0 to 4.3.1") let safariMigration4_3_1 = SafariMigration4_3_1(resources: resources, safariProtection: safariProtection as! SafariProtectionMigrationsProtocol) let dnsMigration4_3_1 = DnsMigration4_3_1(resources: resources, dnsProtection: dnsProtection) safariMigration4_3_1.migrate() - DDLogInfo("(MigrationService) - Successfully migrate safari rules from 4.3.0 to 4.3.1") + LOG.info("Successfully migrate safari rules from 4.3.0 to 4.3.1") dnsMigration4_3_1.migrate() - DDLogInfo("(MigrationService) - Successfully migrate dns rules from 4.3.0 to 4.3.1") + LOG.info("Successfully migrate dns rules from 4.3.0 to 4.3.1") } let currentBuildVersion = Int(productInfo.buildNumber()) diff --git a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsMigration4_3.swift b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsMigration4_3.swift index d473b126e..50c4463f1 100644 --- a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsMigration4_3.swift +++ b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsMigration4_3.swift @@ -24,6 +24,8 @@ protocol DnsMigration4_3Protocol { func migrate() } +private let LOG = LoggerFactory.getLoggerWrapper(DnsMigration4_3.self) + class DnsMigration4_3: DnsMigration4_3Protocol { private let resources: AESharedResourcesProtocol @@ -64,10 +66,10 @@ class DnsMigration4_3: DnsMigration4_3Protocol { func migrate() { - Logger.logInfo("(DnsMigration4_3) migrate called") + LOG.info("Migrate called") switch stateManager.state { case .notStarted: - Logger.logInfo("(DnsMigration4_3) start migration") + LOG.info("Start migration") stateManager.start() do { @@ -75,24 +77,24 @@ class DnsMigration4_3: DnsMigration4_3Protocol { try migrateDnsStatistics() stateManager.finish() - Logger.logInfo("(DnsMigration4_3) migration succeeded") + LOG.info("Migration succeeded") } catch { - Logger.logError("(DnsMigration4_3) failure: \(error)") + LOG.error("Failure: \(error)") stateManager.failure() } case .finished: - Logger.logInfo("(DnsMigration4_3) allready migrated") + LOG.info("Allready migrated") return case .started: - Logger.logInfo("(DnsMigration4_3) allready started. Wait for finish.") + LOG.info("Allready started. Wait for finish.") // wait for finish let group = DispatchGroup() group.enter() stateManager.onMigrationFinished { - Logger.logInfo("(DnsMigration4_3) migration finished") + LOG.info("Migration finished") group.leave() } @@ -100,7 +102,7 @@ class DnsMigration4_3: DnsMigration4_3Protocol { // TODO: - Refactor it later let waitResult = group.wait(timeout: .now() + 10.0) - Logger.logInfo("(DnsMigration4_3) the wait is over; waitResult successeeded=\(waitResult == .success)") + LOG.info("The wait is over; waitResult successeeded=\(waitResult == .success)") return } } diff --git a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsMigration4_3_1.swift b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsMigration4_3_1.swift index 5990af5fb..d1963a09c 100644 --- a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsMigration4_3_1.swift +++ b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsMigration4_3_1.swift @@ -24,6 +24,8 @@ protocol DnsMigration4_3_1Protocol { func migrate() } +private let LOG = LoggerFactory.getLoggerWrapper(DnsMigration4_3_1.self) + final class DnsMigration4_3_1: DnsMigration4_3_1Protocol { // MARK: - Private properties @@ -45,7 +47,7 @@ final class DnsMigration4_3_1: DnsMigration4_3_1Protocol { case .notStarted: onNotStarted() case .finished: - Logger.logInfo("(DnsMigration4_3_1) - migrate; Migration already finished") + LOG.info("Migration already finished") case .started: onStarted() } @@ -54,27 +56,27 @@ final class DnsMigration4_3_1: DnsMigration4_3_1Protocol { // MARK: - Private methods private func onNotStarted() { - Logger.logInfo("(DnsMigration4_3_1) - onNotStarted; Start migration") + LOG.info("Start migration") stateManager.start() do { try migrateDnsRules(for: .blocklist) try migrateDnsRules(for: .allowlist) stateManager.finish() - Logger.logInfo("(DnsMigration4_3_1) - onNotStarted; Migration succeeded") + LOG.info("Migration succeeded") } catch { stateManager.failure() - Logger.logError("(DnsMigration4_3_1) - onNotStarted; Migration failed: \(error)") + LOG.error("Migration failed: \(error)") } } private func onStarted() { - Logger.logInfo("(DnsMigration4_3_1) - onStarted; Migration already started. Wait it") + LOG.info("Migration already started. Wait it") // wait for finish let group = DispatchGroup() group.enter() stateManager.onMigrationFinished { - Logger.logInfo("DnsMigration4_3_1) - onStarted; Migration finished") + LOG.info("Migration finished") group.leave() } @@ -82,14 +84,14 @@ final class DnsMigration4_3_1: DnsMigration4_3_1Protocol { // TODO: - Refactor it later let waitResult = group.wait(timeout: .now() + 3.0) - Logger.logInfo("DnsMigration4_3_1) - onStarted; The wait is over; waitResult succeeded=\(waitResult == .success)") + LOG.info("The wait is over; waitResult succeeded=\(waitResult == .success)") } private func migrateDnsRules(for type: DnsUserRuleType) throws { - Logger.logInfo("(DnsMigration4_3_1) - migrateDnsRules; Starting migrate safari rules for type=\(type)") + LOG.info("Starting migrate safari rules for type=\(type)") let rules = dnsProtection.allRules(for: type) if rules.isEmpty { - Logger.logInfo("(DnsMigration4_3_1) - migrateDnsRules; Dns rules migration for type=\(type) not started; Reason: nothing to migrate") + LOG.info("Dns rules migration for type=\(type) not started; Reason: nothing to migrate") return } dnsProtection.removeAllRules(for: type) @@ -111,6 +113,6 @@ final class DnsMigration4_3_1: DnsMigration4_3_1Protocol { } try dnsProtection.add(rules: rulesNeedToSet, override: true, for: type) - Logger.logInfo("(DnsMigration4_3_1) - migrateDnsRules; Dns rules migration for type=\(type) ended with success") + LOG.info("Dns rules migration for type=\(type) ended with success") } } diff --git a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsProtectionCustomProvidersMigrationHelper.swift b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsProtectionCustomProvidersMigrationHelper.swift index 3204f7225..bb4fbe8d4 100644 --- a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsProtectionCustomProvidersMigrationHelper.swift +++ b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsProtectionCustomProvidersMigrationHelper.swift @@ -17,6 +17,7 @@ // import DnsAdGuardSDK +import SharedAdGuardSDK /// This object is a helper for `SDKMigrationServiceHelper` /// It is responsible for providing old DNS custom providers objects, saving them to SDK storage, selecting and removing old data @@ -34,6 +35,8 @@ protocol DnsProtectionCustomProvidersMigrationHelperProtocol: AnyObject { func removeOldCustomDnsProvidersData() } +private let LOG = LoggerFactory.getLoggerWrapper(DnsProtectionCustomProvidersMigrationHelper.self) + /// Implementation for `DnsProtectionCustomProvidersMigrationHelperProtocol` final class DnsProtectionCustomProvidersMigrationHelper: DnsProtectionCustomProvidersMigrationHelperProtocol { @@ -53,16 +56,16 @@ final class DnsProtectionCustomProvidersMigrationHelper: DnsProtectionCustomProv let data = resources.sharedDefaults().object(forKey: "APDefaultsCustomDnsProviders") as? Data, let customProviders = NSKeyedUnarchiver.unarchiveObject(with: data) as? [SDKDnsMigrationObsoleteCustomDnsProvider] else { - DDLogInfo("(DnsProtectionCustomProvidersMigrationHelper) - getCustomDnsProviders; Failed to find custom DNS providers") + LOG.info("Failed to find custom DNS providers") return [] } - DDLogInfo("(DnsProtectionCustomProvidersMigrationHelper) - getCustomDnsProviders; Found \(customProviders.count) custom DNS providers") + LOG.info("Found \(customProviders.count) custom DNS providers") return customProviders } func saveCustomDnsProviders(_ providers: [SDKDnsMigrationObsoleteCustomDnsProvider]) throws { - DDLogInfo("(DnsProtectionCustomProvidersMigrationHelper) - saveCustomDnsProviders; Saving \(providers.count) providers to SDK") + LOG.info("Saving \(providers.count) providers to SDK") let activeServerInfo = getActiveDnsServerInfo() @@ -70,14 +73,14 @@ final class DnsProtectionCustomProvidersMigrationHelper: DnsProtectionCustomProv let selectAsCurrent = activeServerInfo != nil && $0.providerId == activeServerInfo?.providerId && $0.server.serverId == activeServerInfo?.serverId try dnsProvidersManager.addCustomProvider(name: $0.name, upstreams: [$0.server.upstream], selectAsCurrent: selectAsCurrent, isMigration: true) } - DDLogInfo("(DnsProtectionCustomProvidersMigrationHelper) - saveCustomDnsProviders; Saved \(providers.count) providers to SDK") + LOG.info("Saved \(providers.count) providers to SDK") } func selectActiveDnsServer() throws { - DDLogInfo("(DnsProtectionCustomProvidersMigrationHelper) - selectActiveDnsServer; Selecting active server") + LOG.info("Selecting active server") guard let activeServerInfo = getActiveDnsServerInfo() else { - DDLogInfo("(DnsProtectionCustomProvidersMigrationHelper) - selectActiveDnsServer; Server wasn't selected") + LOG.info("Server wasn't selected") return } @@ -117,11 +120,11 @@ final class DnsProtectionCustomProvidersMigrationHelper: DnsProtectionCustomProv let serverIdString = activeDnsServerParamsDict["serverId"] as? String, let serverId = Int(serverIdString) else { - DDLogInfo("(DnsProtectionCustomProvidersMigrationHelper) - getActiveDnsServerInfo; Active DNS server wasn't saved") + LOG.info("Active DNS server wasn't saved") return nil } - DDLogInfo("(DnsProtectionCustomProvidersMigrationHelper) - getActiveDnsServerInfo; Active DNS server provider id=\(providerId); server id=\(serverId)") + LOG.info("Active DNS server provider id=\(providerId); server id=\(serverId)") return (providerId, serverId) } } diff --git a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsProtectionFiltersMigrationHelper.swift b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsProtectionFiltersMigrationHelper.swift index 01704e20b..55be685e3 100644 --- a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsProtectionFiltersMigrationHelper.swift +++ b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsProtectionFiltersMigrationHelper.swift @@ -17,8 +17,8 @@ // import Foundation -import enum SharedAdGuardSDK.CommonError import struct DnsAdGuardSDK.DnsFilter +import SharedAdGuardSDK /// This object is a helper for `SDKMigrationServiceHelper` /// It is responsible for providing DNS filters content and meta from previous storage and saving it in new storage @@ -37,6 +37,8 @@ protocol DnsProtectionFiltersMigrationHelperProtocol: AnyObject { func removeDnsFiltersDataFromOldStorage() } +private let LOG = LoggerFactory.getLoggerWrapper(DnsProtectionFiltersMigrationHelper.self) + /// Implementation of `DnsProtectionFiltersMigrationHelperProtocol` final class DnsProtectionFiltersMigrationHelper: DnsProtectionFiltersMigrationHelperProtocol { @@ -62,12 +64,12 @@ final class DnsProtectionFiltersMigrationHelper: DnsProtectionFiltersMigrationHe return obj as? SDKDnsMigrationObsoleteDnsFilter } - DDLogInfo("(DnsProtectionFiltersMigrationHelper) - getDnsFiltersMeta; Got \(dnsFilters.count) DNS filters meta") + LOG.info("Got \(dnsFilters.count) DNS filters meta") return dnsFilters } func saveDnsFiltersToSDK(_ filters: [SDKDnsMigrationObsoleteDnsFilter]) throws { - DDLogInfo("(DnsProtectionFiltersMigrationHelper) - saveDnsFiltersToSDK; Saving \(filters.count) DNS filters meta to new storage") + LOG.info("Saving \(filters.count) DNS filters meta to new storage") let newDnsFilters = filters.map { return DnsFilter( @@ -91,7 +93,7 @@ final class DnsProtectionFiltersMigrationHelper: DnsProtectionFiltersMigrationHe let filtersData = try encoder.encode(newDnsFilters) resources.sharedDefaults().setValue(filtersData, forKey: "DnsAdGuardSDK.dnsFiltersKey") - DDLogInfo("(DnsProtectionFiltersMigrationHelper) - saveDnsFiltersToSDK; Saved \(filters.count) DNS filters meta to new storage") + LOG.info("Saved \(filters.count) DNS filters meta to new storage") } func removeDnsFiltersDataFromOldStorage() { @@ -115,7 +117,7 @@ final class DnsProtectionFiltersMigrationHelper: DnsProtectionFiltersMigrationHe As custom DNS filters have stayed in same range, we won't change their identifiers */ func replaceFilesForDnsFilters(with ids: [Int]) throws { - DDLogInfo("(DnsProtectionFiltersMigrationHelper) - replaceFilesForDnsFilters; Replacing \(ids.count) DNS filters files to new folder") + LOG.info("Replacing \(ids.count) DNS filters files to new folder") for id in ids { let oldFileName = "dns_filter_\(id).txt" @@ -132,7 +134,7 @@ final class DnsProtectionFiltersMigrationHelper: DnsProtectionFiltersMigrationHe try FileManager.default.removeItem(at: oldFileUrl) } - DDLogInfo("(DnsProtectionFiltersMigrationHelper) - replaceFilesForDnsFilters; Replaced \(ids.count) DNS filters files to new folder") + LOG.info("Replaced \(ids.count) DNS filters files to new folder") } } diff --git a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsProtectionUserRulesMigrationHelper.swift b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsProtectionUserRulesMigrationHelper.swift index 52567e172..11dc374ca 100644 --- a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsProtectionUserRulesMigrationHelper.swift +++ b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/DNS/DnsProtectionUserRulesMigrationHelper.swift @@ -17,6 +17,7 @@ // import Foundation +import SharedAdGuardSDK /// This object is a helper for `SDKMigrationServiceHelper` /// It is responsible for providing DNS allowlist and blocklist rules migration @@ -29,6 +30,8 @@ protocol DnsProtectionUserRulesMigrationHelperProtocol: AnyObject { func removeOldDnsUserRulesFiles() throws } +private let LOG = LoggerFactory.getLoggerWrapper(DnsProtectionUserRulesMigrationHelper.self) + /// Implementation of `DnsProtectionUserRulesMigrationHelperProtocol` final class DnsProtectionUserRulesMigrationHelper: DnsProtectionUserRulesMigrationHelperProtocol { @@ -60,17 +63,17 @@ final class DnsProtectionUserRulesMigrationHelper: DnsProtectionUserRulesMigrati allRulesAllowlist = 10004 */ func moveOldDnsUserRulesToNewFiles() throws { - DDLogInfo("(DnsProtectionUserRulesMigrationHelper) - moveOldDnsUserRulesToNewFiles; Migrating DNS blocklist rules") + LOG.info("Migrating DNS blocklist rules") try migrateBlocklistRules() - DDLogInfo("(DnsProtectionUserRulesMigrationHelper) - moveOldDnsUserRulesToNewFiles; Migrated DNS blocklist rules") + LOG.info("Migrated DNS blocklist rules") - DDLogInfo("(DnsProtectionUserRulesMigrationHelper) - moveOldDnsUserRulesToNewFiles; Migrating DNS allowlist rules") + LOG.info("Migrating DNS allowlist rules") try migrateAllowlistRules() - DDLogInfo("(DnsProtectionUserRulesMigrationHelper) - moveOldDnsUserRulesToNewFiles; Migrated DNS allowlist rules") + LOG.info("Migrated DNS allowlist rules") } func removeOldDnsUserRulesFiles() throws { - DDLogInfo("(DnsProtectionUserRulesMigrationHelper) - removeOldDnsUserRulesFiles; Removing old DNS user rules files") + LOG.info("Removing old DNS user rules files") let oldDnsBlocklistFileUrl = oldDnsUserRulesContainerFolderUrl.appendingPathComponent("dns_filter_1.txt") let oldDnsAllowlistFileUrl = oldDnsUserRulesContainerFolderUrl.appendingPathComponent("dns_filter_2.txt") @@ -83,7 +86,7 @@ final class DnsProtectionUserRulesMigrationHelper: DnsProtectionUserRulesMigrati try FileManager.default.removeItem(at: oldDnsAllowlistFileUrl) } - DDLogInfo("(DnsProtectionUserRulesMigrationHelper) - removeOldDnsUserRulesFiles; Removed old DNS user rules files") + LOG.info("Removed old DNS user rules files") } // MARK: - Private methods diff --git a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/SDKMigrationOldFilesHelper.swift b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/SDKMigrationOldFilesHelper.swift index 19eb684e2..2038a593f 100644 --- a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/SDKMigrationOldFilesHelper.swift +++ b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/SDKMigrationOldFilesHelper.swift @@ -17,6 +17,9 @@ // import Foundation +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(SDKMigrationOldFilesHelperProtocol.self) /// This object is a helper for `MigrationService` /// It is responsible for removing unused files and replace used ones @@ -83,7 +86,7 @@ final class SDKMigrationOldFilesHelper: SDKMigrationOldFilesHelperProtocol { } } catch { - DDLogError("replaceCbJsonFilesSDKMigrationOldFilesHelper) replaceCbJsonFiles - replace error: \(error)") + LOG.error("replaceCbJsonFilesSDKMigrationOldFilesHelper) replaceCbJsonFiles - replace error: \(error)") } } } diff --git a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/AllowlistRules/SafariProtectionAllowlistRulesMigrationHelper.swift b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/AllowlistRules/SafariProtectionAllowlistRulesMigrationHelper.swift index 8aa5e82e5..748e20038 100644 --- a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/AllowlistRules/SafariProtectionAllowlistRulesMigrationHelper.swift +++ b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/AllowlistRules/SafariProtectionAllowlistRulesMigrationHelper.swift @@ -17,7 +17,7 @@ // import Foundation -import enum SharedAdGuardSDK.CommonError +import SharedAdGuardSDK protocol SafariProtectionAllowlistRulesMigrationHelperProtocol: AnyObject { /// Returns swift allowlist rules objects from obsolete rules objects @@ -30,6 +30,8 @@ protocol SafariProtectionAllowlistRulesMigrationHelperProtocol: AnyObject { func removeOldRuleFiles() throws } +private let LOG = LoggerFactory.getLoggerWrapper(SafariProtectionAllowlistRulesMigrationHelper.self) + /// This object is a helper for `SDKMigrationServiceHelper` /// It is responsible for providing old allowlist and inverted allowlist rules objects and removing obsolete files final class SafariProtectionAllowlistRulesMigrationHelper: SafariProtectionAllowlistRulesMigrationHelperProtocol { @@ -50,43 +52,43 @@ final class SafariProtectionAllowlistRulesMigrationHelper: SafariProtectionAllow } func getAllowlistRules() throws -> [SDKSafariMigrationRule] { - DDLogInfo("(SafariProtectionAllowlistRulesMigrationHelper) - Start fetching data from allowlist rule file") + LOG.info("Start fetching data from allowlist rule file") let url = URL(fileURLWithPath: rulesContainerDirectoryPath).appendingPathComponent(oldSafariAllowListRulesFileName) guard fileManager.fileExists(atPath: url.path) else { - DDLogWarn("(SafariProtectionAllowlistRulesMigrationHelper) - allowlist rules file doesn't exist") + LOG.warn("Allowlist rules file doesn't exist") return [] } let data = try Data(contentsOf: url) guard let result = try NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) as? [SDKSafariMigrationAllowlistRule] else { - DDLogWarn("(SafariProtectionAllowlistRulesMigrationHelper) - NSKeyedUnarchiver return nil data for allowlist rules file") + LOG.warn("NSKeyedUnarchiver return nil data for allowlist rules file") return [] } - DDLogInfo("(SafariProtectionAllowlistRulesMigrationHelper) - Allowlist data successfully fetched, rules count: \(result.count)") + LOG.info("Allowlist data successfully fetched, rules count: \(result.count)") return result } func getInvertedAllowlistRules() throws -> [SDKSafariMigrationRule] { - DDLogInfo("(SafariProtectionAllowlistRulesMigrationHelper) - Start fetching data from inverted allowlist rules file") + LOG.info("Start fetching data from inverted allowlist rules file") let url = URL(fileURLWithPath: rulesContainerDirectoryPath).appendingPathComponent(oldSafariInvertedAllowListRulesFileName) guard fileManager.fileExists(atPath: url.path) else { - DDLogWarn("(SafariProtectionAllowlistRulesMigrationHelper) - inverted allowlist rules file doesn't exist") + LOG.warn("Inverted allowlist rules file doesn't exist") return [] } let data = try Data(contentsOf: url) guard let result = try NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) as? SDKSafariMigrationInvertedAllowlistDomainObject else { - DDLogWarn("(SafariProtectionAllowlistRulesMigrationHelper) - NSKeyedUnarchiver return nil data for inverted allowlist rules file") + LOG.warn("NSKeyedUnarchiver return nil data for inverted allowlist rules file") return [] } - DDLogInfo("(SafariProtectionAllowlistRulesMigrationHelper) - Inverted allowlist data successfully fetched, rules count: \(result.rules.count)") + LOG.info("Inverted allowlist data successfully fetched, rules count: \(result.rules.count)") return result.rules } func removeOldRuleFiles() throws { - DDLogInfo("(SafariProtectionAllowlistRulesMigrationHelper) - Start removing rule files") + LOG.info("Start removing rule files") let invertedAllowlistRulesFileUrl = URL(fileURLWithPath: rulesContainerDirectoryPath).appendingPathComponent(oldSafariInvertedAllowListRulesFileName) let allowlistRulesFileUrl = URL(fileURLWithPath: rulesContainerDirectoryPath).appendingPathComponent(oldSafariAllowListRulesFileName) diff --git a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/Database/SafariProtectionCustomFiltersMigrationHelper.swift b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/Database/SafariProtectionCustomFiltersMigrationHelper.swift index 64f65fb32..36153f58b 100644 --- a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/Database/SafariProtectionCustomFiltersMigrationHelper.swift +++ b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/Database/SafariProtectionCustomFiltersMigrationHelper.swift @@ -18,12 +18,15 @@ import SQLite import SafariAdGuardSDK +import SharedAdGuardSDK protocol SafariProtectionCustomFiltersMigrationHelperProtocol: AnyObject { /// Saves custom filter meta to db and filter content to file func migrateCustomFilters(_ filters: [SafariProtectionFiltersDatabaseMigrationHelper.ObsoleteCustomFilter]) throws } +private let LOG = LoggerFactory.getLoggerWrapper(SafariProtectionCustomFiltersMigrationHelper.self) + /// This object is a helper for `SDKMigrationServiceHelper` /// It is responsible for migrating custom filters /// It saves custom filter meta to db and filter content to file @@ -44,7 +47,7 @@ final class SafariProtectionCustomFiltersMigrationHelper: SafariProtectionCustom // `busyHandler` is needed to handle error when db is locked and try once more self.newAdguardDB.busyTimeout = 0.5 self.newAdguardDB.busyHandler { _ in - DDLogInfo("(SafariProtectionCustomFiltersMigrationHelper) - init; adguard.db is locked") + LOG.info("adguard.db is locked") return true } @@ -52,7 +55,7 @@ final class SafariProtectionCustomFiltersMigrationHelper: SafariProtectionCustom } func migrateCustomFilters(_ filters: [SafariProtectionFiltersDatabaseMigrationHelper.ObsoleteCustomFilter]) throws { - DDLogInfo("(SafariProtectionCustomFiltersMigrationHelper) - migrateCustomFilters; Saving \(filters.count) custom filters to new DB") + LOG.info("Saving \(filters.count) custom filters to new DB") try filters.forEach { try addCustomFilterToDb($0) } for filter in filters { diff --git a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/Database/SafariProtectionFiltersDatabaseMigrationHelper.swift b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/Database/SafariProtectionFiltersDatabaseMigrationHelper.swift index 158c6bf3d..e0ef33e29 100644 --- a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/Database/SafariProtectionFiltersDatabaseMigrationHelper.swift +++ b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/Database/SafariProtectionFiltersDatabaseMigrationHelper.swift @@ -18,6 +18,7 @@ import Foundation import SQLite +import SharedAdGuardSDK protocol SafariProtectionFiltersDatabaseMigrationHelperProtocol: AnyObject { /// Returns all groups with states from old DB @@ -36,6 +37,8 @@ protocol SafariProtectionFiltersDatabaseMigrationHelperProtocol: AnyObject { func removeOldDBFiles() throws } +private let LOG = LoggerFactory.getLoggerWrapper(SafariProtectionFiltersDatabaseMigrationHelper.self) + /// This object is a helper for `SDKMigrationServiceHelper` /// It is a wrapper for old `adguard.db` database /// And is responsible for providing user rules, custom filters rules and meta, filters and groups enabled states and removing obsolete db files @@ -63,7 +66,7 @@ final class SafariProtectionFiltersDatabaseMigrationHelper: SafariProtectionFilt ) throws { dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" self.oldAdguardDB = try Connection(oldAdguardDBFilePath, readonly: true) - DDLogInfo("(SafariProtectionFiltersDatabaseMigrationHelper) - Connection with old AdGuard DB established") + LOG.info("Connection with old AdGuard DB established") self.oldAdguardDBFilePath = oldAdguardDBFilePath self.oldDefaultDBFilePath = oldDefaultDBFilePath @@ -72,7 +75,7 @@ final class SafariProtectionFiltersDatabaseMigrationHelper: SafariProtectionFilt // MARK: - Internal methods func getGroupsStates() throws -> [(groupId: Int, isEnabled: Bool)] { - DDLogInfo("(SafariProtectionFiltersDatabaseMigrationHelper) - Fetching data from filter_groups table") + LOG.info("Fetching data from filter_groups table") // Query: SELECT group_id, is_enabled FROM filter_groups let query = FilterGroupsTable.table.select(FilterGroupsTable.groupId, FilterGroupsTable.isEnabled) @@ -83,12 +86,12 @@ final class SafariProtectionFiltersDatabaseMigrationHelper: SafariProtectionFilt return (groupId: table.groupId, isEnabled: table.isEnabled ) } - DDLogInfo("(SafariProtectionFiltersDatabaseMigrationHelper) - Fetched from filter_groups table \(groupIds.count) groups") + LOG.info("Fetched from filter_groups table \(groupIds.count) groups") return groupIds } func getFiltersStates() throws -> [(filterId: Int, groupId: Int, isEnabled: Bool)] { - DDLogInfo("(SafariProtectionFiltersDatabaseMigrationHelper) - Fetching data from filters table") + LOG.info("Fetching data from filters table") // Query: SELECT * FROM filters let query = FiltersTable.table @@ -99,12 +102,12 @@ final class SafariProtectionFiltersDatabaseMigrationHelper: SafariProtectionFilt return (filterId: table.filterId, groupId: table.groupId, isEnabled: table.isEnabled) } - DDLogInfo("(SafariProtectionFiltersDatabaseMigrationHelper) - Fetched from filters table \(filterIds.count) filters") + LOG.info("Fetched from filters table \(filterIds.count) filters") return filterIds } func getUserRules() throws -> [SDKSafariMigrationRule] { - DDLogInfo("(SafariProtectionFiltersDatabaseMigrationHelper) - Fetching data from filter_rules table") + LOG.info("Fetching data from filter_rules table") // Query: SELECT * FROM filter_rules WHERE filter_id == baseUserRulesFilterId let query = FilterRulesTable.table.where(FilterRulesTable.filterId == baseUserRulesFilterId) @@ -113,12 +116,12 @@ final class SafariProtectionFiltersDatabaseMigrationHelper: SafariProtectionFilt return ObsoleteFilterRules(from: filterRulesTable) } - DDLogInfo("(SafariProtectionFiltersDatabaseMigrationHelper) - Fetched from filter_rules table \(userRulesMeta.count) user rules meta") + LOG.info("Fetched from filter_rules table \(userRulesMeta.count) user rules meta") return userRulesMeta } func getCustomFilters() throws -> [ObsoleteCustomFilter] { - DDLogInfo("(SafariProtectionFiltersDatabaseMigrationHelper) - Fetching data from filter_rules table") + LOG.info("Fetching data from filter_rules table") // SELECT * FROM filters WHERE (filter_id >= baseCustomFilterId) let queryCustomFilters = FiltersTable.table.where(FiltersTable.filterId >= baseCustomFilterId) @@ -126,7 +129,7 @@ final class SafariProtectionFiltersDatabaseMigrationHelper: SafariProtectionFilt let customFiltersFromDb = try oldAdguardDB.prepare(queryCustomFilters).map { row in return FiltersTable(dbFilter: row) } - DDLogInfo("(SafariProtectionFiltersDatabaseMigrationHelper) - Fetched from filters table \(customFiltersFromDb.count) custom filters") + LOG.info("Fetched from filters table \(customFiltersFromDb.count) custom filters") return try customFiltersFromDb.map { customFilter in // SELECT * FROM filter_rules WHERE (filter_id == customFilter.filterId) @@ -136,17 +139,17 @@ final class SafariProtectionFiltersDatabaseMigrationHelper: SafariProtectionFilt let filterRulesTable = FilterRulesTable(dbFilterRule: row) return ObsoleteFilterRules(from: filterRulesTable) } - DDLogInfo("(SafariProtectionFiltersDatabaseMigrationHelper) - Fetched \(customFilterRules.count) rules for custom filter with id=\(customFilter.filterId)") + LOG.info("Fetched \(customFilterRules.count) rules for custom filter with id=\(customFilter.filterId)") return ObsoleteCustomFilter(from: customFilter, rules: customFilterRules) } } func removeOldDBFiles() throws { - DDLogInfo("(SafariProtectionFiltersDatabaseMigrationHelper) - Removing old DB files") + LOG.info("Removing old DB files") try fileManager.removeItem(atPath: oldAdguardDBFilePath) try fileManager.removeItem(atPath: oldDefaultDBFilePath) - DDLogInfo("(SafariProtectionFiltersDatabaseMigrationHelper) - Removed old DB files") + LOG.info("Removed old DB files") } } diff --git a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/SafariMigration4_3.swift b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/SafariMigration4_3.swift index 9f602700f..328f56ba6 100644 --- a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/SafariMigration4_3.swift +++ b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/SafariMigration4_3.swift @@ -24,6 +24,8 @@ protocol SafariMigration4_3Protocol { func migrate() } +private let LOG = LoggerFactory.getLoggerWrapper(SafariMigration4_3.self) + class SafariMigration4_3: SafariMigration4_3Protocol { private let stateManager: MigrationStateManagerProtocol @@ -56,32 +58,32 @@ class SafariMigration4_3: SafariMigration4_3Protocol { func migrate() { - Logger.logInfo("(SafariMigration4_3) migrate called") + LOG.info("Migrate called") switch stateManager.state { case .notStarted: - Logger.logInfo("(SafariMigration4_3) start migration") + LOG.info("Start migration") stateManager.start() do { try migrateSafariProtection() stateManager.finish() - Logger.logInfo("(SafariMigration4_3) migration succeeded") + LOG.info("Migration succeeded") } catch { stateManager.failure() - Logger.logError("(SafariMigration4_3) migration failed: \(error)") + LOG.error("Migration failed: \(error)") } case .finished: - Logger.logInfo("(SafariMigration4_3) migration allready finished") + LOG.info("Migration allready finished") return case .started: - Logger.logInfo("(SafariMigration4_3) migration allready started. Wait it") + LOG.info("Migration allready started. Wait it") // wait for finish let group = DispatchGroup() group.enter() stateManager.onMigrationFinished { - Logger.logInfo("(SafariMigration4_3) migration finished") + LOG.info("Migration finished") group.leave() } @@ -89,7 +91,7 @@ class SafariMigration4_3: SafariMigration4_3Protocol { // TODO: - Refactor it later let waitResult = group.wait(timeout: .now() + 10.0) - Logger.logInfo("(SafariMigration4_3) the wait is over; waitResult successeeded=\(waitResult == .success)") + LOG.info("The wait is over; waitResult successeeded=\(waitResult == .success)") return } } diff --git a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/SafariMigration4_3_1.swift b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/SafariMigration4_3_1.swift index bff16a906..dacc7a8cd 100644 --- a/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/SafariMigration4_3_1.swift +++ b/AdguardExtension/AdguardApp/Services/Migrations/MigrationToSDKv4.3/Safari/SafariMigration4_3_1.swift @@ -24,6 +24,8 @@ protocol SafariMigration4_3_1Protocol { func migrate() } +private let LOG = LoggerFactory.getLoggerWrapper(SafariMigration4_3_1.self) + final class SafariMigration4_3_1: SafariMigration4_3_1Protocol { // MARK: - Private properties @@ -41,12 +43,12 @@ final class SafariMigration4_3_1: SafariMigration4_3_1Protocol { // MARK: - Public methods func migrate() { - Logger.logInfo("(SafariMigration4_3_1) - migrate; Migrate called") + LOG.info("Migrate called") switch stateManager.state { case .notStarted: onNotStarted() case .finished: - Logger.logInfo("(SafariMigration4_3_1) - migrate; Migration already finished") + LOG.info("Migration already finished") case .started: onStarted() } @@ -55,7 +57,7 @@ final class SafariMigration4_3_1: SafariMigration4_3_1Protocol { // MARK: - Private methods private func onNotStarted() { - Logger.logInfo("(SafariMigration4_3_1) - onNotStarted; Start migration") + LOG.info("Start migration") stateManager.start() do { @@ -63,28 +65,28 @@ final class SafariMigration4_3_1: SafariMigration4_3_1Protocol { try migrateSafariRules(for: .allowlist) try migrateSafariRules(for: .invertedAllowlist) stateManager.finish() - Logger.logInfo("(SafariMigration4_3_1) - onNotStarted; Migration succeeded") + LOG.info("Migration succeeded") safariProtection.convertFiltersAndReloadCbs { error in if let error = error { - Logger.logInfo("(SafariMigration4_3_1) - onNotStarted; Error occurred while reloading CBs; Error: \(error)") + LOG.info("Error occurred while reloading CBs; Error: \(error)") return } - Logger.logInfo("(SafariMigration4_3_1) - onNotStarted; Successfully reload CBs after safari user rules migration") + LOG.info("Successfully reload CBs after safari user rules migration") } } catch { stateManager.failure() - Logger.logError("(SafariMigration4_3_1) - onNotStarted; Migration failed: \(error)") + LOG.error("Migration failed: \(error)") } } private func onStarted() { - Logger.logInfo("(SafariMigration4_3_1) - onStarted; Migration already started. Wait it") + LOG.info("Migration already started. Wait it") // wait for finish let group = DispatchGroup() group.enter() stateManager.onMigrationFinished { - Logger.logInfo("SafariMigration4_3_1) - onStarted; Migration finished") + LOG.info("Migration finished") group.leave() } @@ -92,14 +94,14 @@ final class SafariMigration4_3_1: SafariMigration4_3_1Protocol { // TODO: - Refactor it later let waitResult = group.wait(timeout: .now() + 3.0) - Logger.logInfo("SafariMigration4_3_1) - onStarted; The wait is over; waitResult succeeded=\(waitResult == .success)") + LOG.info("The wait is over; waitResult succeeded=\(waitResult == .success)") } private func migrateSafariRules(for type: SafariUserRuleType) throws { - Logger.logInfo("(SafariMigration4_3_1) - migrateSafariRules; Starting migrate safari rules for type=\(type)") + LOG.info("Starting migrate safari rules for type=\(type)") let rules = safariProtection.getRules(for: type) if rules.isEmpty { - Logger.logInfo("(SafariMigration4_3_1) - migrateSafariRules; Safari rules migration for type=\(type) not started; Reason: nothing to migrate") + LOG.info("Safari rules migration for type=\(type) not started; Reason: nothing to migrate") return } safariProtection.removeRules(for: type) @@ -121,6 +123,6 @@ final class SafariMigration4_3_1: SafariMigration4_3_1Protocol { } try safariProtection.add(rules: rulesNeedToSet, for: type, override: true) - Logger.logInfo("(SafariMigration4_3_1) - migrateSafariRules; Safari rules migration for type=\(type) ended with success") + LOG.info("Safari rules migration for type=\(type) ended with success") } } diff --git a/AdguardExtension/AdguardApp/Services/Migrations/NetworkSettingsMigration.swift b/AdguardExtension/AdguardApp/Services/Migrations/NetworkSettingsMigration.swift index 984c14f78..53a33307a 100644 --- a/AdguardExtension/AdguardApp/Services/Migrations/NetworkSettingsMigration.swift +++ b/AdguardExtension/AdguardApp/Services/Migrations/NetworkSettingsMigration.swift @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with Adguard for iOS. If not, see . // +import SharedAdGuardSDK /// Network settings migration protocol protocol NetworkSettingsMigrationProtocol { @@ -25,6 +26,8 @@ protocol NetworkSettingsMigrationProtocol { func startMigration() } +private let LOG = LoggerFactory.getLoggerWrapper(NetworkSettingsMigrations.self) + /// Network settings migration service final class NetworkSettingsMigrations: NetworkSettingsMigrationProtocol { @@ -47,16 +50,16 @@ final class NetworkSettingsMigrations: NetworkSettingsMigrationProtocol { func startMigration() { let exceptions = fetchOldWifiExceptions() if exceptions.isEmpty { - DDLogWarn("(NetworkSettingsMigration) - startMigration; Nothing to migrate") + LOG.warn("Nothing to migrate") return } do { try exceptions.forEach { try networkSettingsService.add(exception: $0) } removeOldExceptionsFile() - DDLogInfo("(NetworkSettingsMigration) - startMigration; All \(exceptions.count) exceptions successfully migrated") + LOG.info("All \(exceptions.count) exceptions successfully migrated") } catch { - DDLogError("(NetworkSettingsMigration) - startMigration; On adding exception error occurred: \(error)") + LOG.error("On adding exception error occurred: \(error)") } } @@ -65,12 +68,12 @@ final class NetworkSettingsMigrations: NetworkSettingsMigrationProtocol { private func fetchOldWifiExceptions() -> [WifiException] { do { guard let data = resources.loadData(fromFileRelativePath: jsonNetworkSettingsFileName) else { - DDLogError("(NetworkSettingsMigration) - fetchOldWifiException; Failed to load wifi exceptions from file") + LOG.error("Failed to load wifi exceptions from file") return [] } return try JSONDecoder().decode([WifiException].self, from: data) } catch { - DDLogInfo("(NetworkSettingsMigration) - fetchOldWifiException; Decoding network settings error occurred: \(error)") + LOG.info("Decoding network settings error occurred: \(error)") return [] } } @@ -80,14 +83,14 @@ final class NetworkSettingsMigrations: NetworkSettingsMigrationProtocol { do { let path = resources.path(forRelativePath: jsonNetworkSettingsFileName) guard fileManager.fileExists(atPath: path) else { - DDLogWarn("(NetworkSettingsMigration) - removeOldExceptionsFile; File doesn't exists") + LOG.warn("File doesn't exists") return } try fileManager.removeItem(atPath: path) - DDLogInfo("(NetworkSettingsMigration) - removeOldExceptionsFile; Exception file successfully removed") + LOG.info("Exception file successfully removed") } catch { - DDLogError("(NetworkSettingsMigration) - removeOldExceptionsFile; Error occurred while removing exception file: \(error)") + LOG.error("Error occurred while removing exception file: \(error)") } } } diff --git a/AdguardExtension/AdguardApp/Services/NativeDnsService/NativeDnsSettingsManager.swift b/AdguardExtension/AdguardApp/Services/NativeDnsService/NativeDnsSettingsManager.swift index 6a9af8b53..06fef1726 100644 --- a/AdguardExtension/AdguardApp/Services/NativeDnsService/NativeDnsSettingsManager.swift +++ b/AdguardExtension/AdguardApp/Services/NativeDnsService/NativeDnsSettingsManager.swift @@ -19,6 +19,7 @@ import UIKit.UIApplication import NetworkExtension import DnsAdGuardSDK +import SharedAdGuardSDK enum NativeDnsSettingsManagerError: Error { case unsupportedDnsProtocol @@ -53,6 +54,8 @@ protocol NativeDnsSettingsManagerProtocol: AnyObject { func reset() } +private let LOG = LoggerFactory.getLoggerWrapper(NativeDnsSettingsManager.self) + /// Config Manager is responsible for controlling and providing actual state of DNS mobile config that can be found here final class NativeDnsSettingsManager: NativeDnsSettingsManagerProtocol { @@ -126,7 +129,7 @@ final class NativeDnsSettingsManager: NativeDnsSettingsManagerProtocol { loadDnsManager { [weak self] dnsManager in guard let manager = dnsManager else { - DDLogError("(NativeDnsConfigManager) - saveDnsManager; Received nil DNS manager") + LOG.error("Received nil DNS manager") onErrorReceived(NativeDnsSettingsManagerError.failedToLoadManager) return } @@ -139,7 +142,7 @@ final class NativeDnsSettingsManager: NativeDnsSettingsManagerProtocol { func removeDnsConfig(_ onErrorReceived: @escaping (_ error: Error?) -> Void) { loadDnsManager { [weak self] dnsManager in guard let dnsManager = dnsManager else { - DDLogError("(NativeDnsConfigManager) - removeDnsManager; Received nil DNS manager") + LOG.error("Received nil DNS manager") onErrorReceived(NativeDnsSettingsManagerError.failedToLoadManager) return } @@ -156,7 +159,7 @@ final class NativeDnsSettingsManager: NativeDnsSettingsManagerProtocol { func reset() { removeDnsConfig { error in if let error = error { - DDLogError("(NativeDnsConfigManager) - reset; Error when resetting settings; Error: \(error)") + LOG.error("Error when resetting settings; Error: \(error)") } } } @@ -168,7 +171,7 @@ final class NativeDnsSettingsManager: NativeDnsSettingsManagerProtocol { let dnsManager = NEDNSSettingsManager.shared() dnsManager.loadFromPreferences { error in if let error = error { - DDLogError("(NativeDnsConfigManager) - loadDnsManager; Loading error: \(error)") + LOG.error("Loading error: \(error)") onManagerLoaded(nil) return } @@ -180,7 +183,7 @@ final class NativeDnsSettingsManager: NativeDnsSettingsManagerProtocol { private func getDnsManagerStatus(_ onStatusReceived: @escaping (_ status: ManagerStatus) -> Void) { loadDnsManager { dnsManager in guard let manager = dnsManager else { - DDLogError("(NativeDnsConfigManager) - getDnsManagerStatus; Received nil DNS manager") + LOG.error("Received nil DNS manager") onStatusReceived(ManagerStatus()) return } @@ -247,13 +250,13 @@ final class NativeDnsSettingsManager: NativeDnsSettingsManagerProtocol { if self?.resources.dnsImplementation == .native { self?.saveDnsConfig({ error in if let error = error { - DDLogError("(NativeDnsConfigManager) - dnsImplementationObserver; Saving dns manager error: \(error)") + LOG.error("Saving dns manager error: \(error)") } }) } else { self?.removeDnsConfig({ error in if let error = error { - DDLogError("(NativeDnsConfigManager) - dnsImplementationObserver; Removing dns manager error: \(error)") + LOG.error("Removing dns manager error: \(error)") } }) } @@ -276,13 +279,13 @@ final class NativeDnsSettingsManager: NativeDnsSettingsManagerProtocol { if !self.configuration.proStatus { self.removeDnsConfig{ error in if let error = error { - DDLogError("(NativeDnsConfigManager) - proObservation; Removing dns manager error: \(error)") + LOG.error("Removing dns manager error: \(error)") } } } else if self.resources.dnsImplementation == .native && self.configuration.proStatus { self.saveDnsConfig { error in if let error = error { - DDLogError("(NativeDnsConfigManager) - proObservation; Saving dns manager error: \(error)") + LOG.error("Saving dns manager error: \(error)") } } } diff --git a/AdguardExtension/AdguardApp/Services/Protection/ComplexProtectionService.swift b/AdguardExtension/AdguardApp/Services/Protection/ComplexProtectionService.swift index 02fae91c1..843434066 100644 --- a/AdguardExtension/AdguardApp/Services/Protection/ComplexProtectionService.swift +++ b/AdguardExtension/AdguardApp/Services/Protection/ComplexProtectionService.swift @@ -19,6 +19,7 @@ import UIKit import NetworkExtension import SafariAdGuardSDK +import SharedAdGuardSDK // MARK: - Complex protection Interface - @@ -43,6 +44,8 @@ enum ComplexProtectionError: Error { case invalidDnsImplementation } +private let LOG = LoggerFactory.getLoggerWrapper(ComplexProtectionService.self) + // MARK: - Complex protection class - final class ComplexProtectionService: ComplexProtectionServiceProtocol{ @@ -94,7 +97,7 @@ final class ComplexProtectionService: ComplexProtectionServiceProtocol{ addObservers() checkVpnInstalled() - DDLogInfo("(ComplexProtectionService) - ComplexProtectionService was initialized") + LOG.info("ComplexProtectionService was initialized") } func switchComplexProtection(state enabled: Bool, for VC: UIViewController?, completion: @escaping (_ safariError: Error?,_ systemError: Error?)->Void) { @@ -104,11 +107,11 @@ final class ComplexProtectionService: ComplexProtectionServiceProtocol{ let advancedProtectionEnabledOld = configuration.isAdvancedProtectionEnabled resources.complexProtectionEnabled = enabled - DDLogInfo("(ComplexProtectionService) - complexProtection state: \(complexEnabledOld)") - DDLogInfo("(ComplexProtectionService) - safariEnabled state: \(safariEnabledOld)") - DDLogInfo("(ComplexProtectionService) - systemProtection state: \(systemEnabledOld)") - DDLogInfo("(ComplexProtectionService) - advancedProtection state: \(advancedProtectionEnabledOld)") - DDLogInfo("(ComplexProtectionService) - switchComplexProtection to state: \(enabled)") + LOG.info("complexProtection state: \(complexEnabledOld)") + LOG.info("safariEnabled state: \(safariEnabledOld)") + LOG.info("systemProtection state: \(systemEnabledOld)") + LOG.info("advancedProtection state: \(advancedProtectionEnabledOld)") + LOG.info("switchComplexProtection to state: \(enabled)") if enabled && !safariEnabledOld && !systemEnabledOld { resources.safariProtectionEnabled = true @@ -157,11 +160,11 @@ final class ComplexProtectionService: ComplexProtectionServiceProtocol{ let safariOld = resources.safariProtectionEnabled let advancedProtectionOld = configuration.isAdvancedProtectionEnabled - DDLogInfo("(ComplexProtectionService) - complexProtection state: \(resources.complexProtectionEnabled)") - DDLogInfo("(ComplexProtectionService) - systemProtection state: \(systemOld)") - DDLogInfo("(ComplexProtectionService) - safariProtection state: \(safariOld)") - DDLogInfo("(ComplexProtectionService) - advancedProtection state: \(advancedProtectionOld)") - DDLogInfo("(ComplexProtectionService) - switchSafariProtection to state: \(enabled)") + LOG.info("complexProtection state: \(resources.complexProtectionEnabled)") + LOG.info("systemProtection state: \(systemOld)") + LOG.info("safariProtection state: \(safariOld)") + LOG.info("advancedProtection state: \(advancedProtectionOld)") + LOG.info("switchSafariProtection to state: \(enabled)") if enabled && !resources.complexProtectionEnabled { resources.complexProtectionEnabled = true @@ -240,17 +243,17 @@ final class ComplexProtectionService: ComplexProtectionServiceProtocol{ group.enter() self.safariProtection.update(safariProtectionEnabled: self.safariProtectionEnabled ) { error in safariError = error - DDLogInfo("(ComplexProtectionService) - Ending updating safari protection with error - \(error?.localizedDescription ?? "nil")") + LOG.info("Ending updating safari protection with error - \(error?.localizedDescription ?? "nil")") group.leave() } } if system { - DDLogInfo("(ComplexProtectionService) - Begining updating dns protection") + LOG.info("Beginning updating dns protection") group.enter() self.updateVpnSettings(vc: vc) { error in systemError = error - DDLogInfo("(ComplexProtectionService) - Ending updating safari protection with error - \(error?.localizedDescription ?? "nil")") + LOG.info("Ending updating safari protection with error - \(error?.localizedDescription ?? "nil")") group.leave() } } @@ -265,11 +268,11 @@ final class ComplexProtectionService: ComplexProtectionServiceProtocol{ let needsUpdateSafari = false let needsUpdateSystem = true - DDLogInfo("(ComplexProtectionService) - complexProtection state: \(resources.complexProtectionEnabled)") - DDLogInfo("(ComplexProtectionService) - systemProtection state: \(resources.systemProtectionEnabled)") - DDLogInfo("(ComplexProtectionService) - safariProtection state: \(resources.safariProtectionEnabled)") - DDLogInfo("(ComplexProtectionService) - advancedProtection state \(configuration.isAdvancedProtectionEnabled)") - DDLogInfo("(ComplexProtectionService) - switchSystemProtection to state: \(enabled)") + LOG.info("complexProtection state: \(resources.complexProtectionEnabled)") + LOG.info("systemProtection state: \(resources.systemProtectionEnabled)") + LOG.info("safariProtection state: \(resources.safariProtectionEnabled)") + LOG.info("advancedProtection state \(configuration.isAdvancedProtectionEnabled)") + LOG.info("switchSystemProtection to state: \(enabled)") if enabled && !resources.complexProtectionEnabled { resources.complexProtectionEnabled = true @@ -292,7 +295,7 @@ final class ComplexProtectionService: ComplexProtectionServiceProtocol{ private func updateVpnSettings(vc: UIViewController?, completion: @escaping (Error?)->Void) { if !proStatus { - DDLogInfo("(ComplexProtectionService) Failed \(#function) with reason: proStatus - \(proStatus)") + LOG.info("Failed \(#function) with reason: proStatus - \(proStatus)") completion(nil) return } @@ -325,14 +328,14 @@ final class ComplexProtectionService: ComplexProtectionServiceProtocol{ private func addObservers() { vpnConfigurationObserver = NotificationCenter.default.observe(name: VpnManager.configurationRemovedNotification, object: nil, queue: nil) { [weak self] (note) in - DDLogInfo("(ComplexProtectionService) configurationRemovedNotification called") + LOG.info("configurationRemovedNotification called") guard let self = self else { return } self.resources.systemProtectionEnabled = false NotificationCenter.default.post(name: ComplexProtectionService.systemProtectionChangeNotification, object: self) } vpnStateChangeObserver = NotificationCenter.default.observe(name: VpnManager.stateChangedNotification, object: nil, queue: nil) { [weak self] (note) in - DDLogInfo("(ComplexProtectionService) stateChangedNotification called") + LOG.info("stateChangedNotification called") guard let self = self else { return } if let enabled = note.object as? Bool { self.resources.systemProtectionEnabled = enabled @@ -346,7 +349,7 @@ final class ComplexProtectionService: ComplexProtectionServiceProtocol{ } dnsImplementationObserver = NotificationCenter.default.observe(name: .dnsImplementationChanged, object: nil, queue: nil) { [weak self] _ in - DDLogInfo("(ComplexProtectionService) dnsImplementationChanged called") + LOG.info("dnsImplementationChanged called") guard let self = self else { return } if self.resources.dnsImplementation == .adGuard { @@ -356,7 +359,7 @@ final class ComplexProtectionService: ComplexProtectionServiceProtocol{ guard let self = self else { return } if let error = error { - DDLogError("Failed to turn off system protection, error: \(error.localizedDescription)") + LOG.error("Failed to turn off system protection, error: \(error.localizedDescription)") } let managerIsEnabled = self.nativeDnsSettingsManager.dnsConfigIsEnabled @@ -371,7 +374,7 @@ final class ComplexProtectionService: ComplexProtectionServiceProtocol{ vpnManager.checkVpnInstalled { [weak self] error in guard let self = self else { return } if error != nil { - DDLogError("(ComplexProtectionService) checkVpnInstalled error: \(error!)") + LOG.error("checkVpnInstalled error: \(error!)") } else { if !self.vpnManager.vpnInstalled { @@ -419,7 +422,7 @@ final class ComplexProtectionService: ComplexProtectionServiceProtocol{ private func updateAdvancedProtection(withState: Bool, withReloadCB: Bool = false) { guard #available(iOS 15.0, *), configuration.proStatus else { return } - DDLogInfo("(ComplexProtectionService) - updateAdvancedProtection; Updating advanced protection with new state = \(withState)") + LOG.info("Updating advanced protection with new state = \(withState)") configuration.isAdvancedProtectionEnabled = withState if withReloadCB { safariProtection.update(advancedProtectionEnabled: withState, onCbReloaded: nil) diff --git a/AdguardExtension/AdguardApp/Services/Purchase/PurchaseService.swift b/AdguardExtension/AdguardApp/Services/Purchase/PurchaseService.swift index 2508ff3ce..058e0a870 100644 --- a/AdguardExtension/AdguardApp/Services/Purchase/PurchaseService.swift +++ b/AdguardExtension/AdguardApp/Services/Purchase/PurchaseService.swift @@ -20,7 +20,7 @@ import Foundation import StoreKit import CommonCrypto import Setapp -import class SharedAdGuardSDK.Atomic +import SharedAdGuardSDK typealias Period = (unit: PurchasePeriod, numberOfUnits: Int) @@ -48,6 +48,8 @@ typealias Product = (type: ProductType, price: String, period: Period?, trialPer Work with Adguard Licenses is delegated to EmailSignInController */ +private let LOG = LoggerFactory.getLoggerWrapper(PurchaseService.self) + // MARK: - service implementation - final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransactionObserver, SKProductsRequestDelegate { @@ -153,7 +155,7 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac case lifetimeProductID, lifetimeAlternateProductID: type = .lifetime default: - DDLogError("(PurchaseService) error, product with unknown product id: \(product.productIdentifier)") + LOG.error("Error, product with unknown product id: \(product.productIdentifier)") assertionFailure("product with unknown product id: \(product.productIdentifier)") continue } @@ -258,7 +260,7 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac let expectedState = resources.sharedDefaults().string(forKey: AEDefaultsAuthStateString) if token == nil || state == nil || expectedState == nil || state! != expectedState! { - DDLogError("(PurchaseService) login with access token failed " + (token == nil ? "token == nil" : "") + (state == nil ? "state == nil" : "") + (expectedState == nil ? "expectedState == nil" : "") + (state != expectedState ? "state != expectedState" : "")) + LOG.error("Login with access token failed " + (token == nil ? "token == nil" : "") + (state == nil ? "state == nil" : "") + (expectedState == nil ? "expectedState == nil" : "") + (state != expectedState ? "state != expectedState" : "")) postNotification(PurchaseAssistant.kPSNotificationLoginFailure, nil) return } @@ -296,7 +298,7 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac // post receipt to our backend guard let appId = keychain.appId else { - DDLogError("(LoginService) loginInternal error - can not obtain appId)") + LOG.error("loginInternal error - can not obtain appId)") complete(NSError(domain: PurchaseAssistant.AEPurchaseErrorDomain, code: PurchaseAssistant.AEConfirmReceiptError, userInfo: [:])) return } @@ -312,7 +314,7 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac guard let url = URL(string: VALIDATE_RECEIPT_URL) else { - DDLogError("(PurchaseService) validateReceipt error. Can not make URL from String \(VALIDATE_RECEIPT_URL)") + LOG.error("ValidateReceipt error. Can not make URL from String \(VALIDATE_RECEIPT_URL)") return } @@ -364,11 +366,11 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac func checkPremiumStatusChanged() { - DDLogInfo("(PurchaseService) checkPremiumExpired") + LOG.info("checkPremiumExpired") // we must validate receipts not only to check the expiration of the subscription, // but also for restoring purchases after reinstalling the application - DDLogInfo("(PurchaseService) checkPremiumExpired - validateReceipt") + LOG.info("checkPremiumExpired - validateReceipt") let wasActive = self.isInAppPurchaseActive() validateReceipt { [weak self] _ in guard let self = self else { return } @@ -382,7 +384,7 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac } if loginService.loggedIn && loginService.hasPremiumLicense { - DDLogInfo("(PurchaseService) checkPremiumExpired - сheck adguard license status") + LOG.info("checkPremiumExpired - сheck adguard license status") checkStatusInternal { [weak self] error in if error != nil || !(self?.loginService.active ?? false) { @@ -437,7 +439,7 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) { - DDLogInfo("(PurchaseService) paymentQueue updatedTransactions") + LOG.info("paymentQueue updatedTransactions") var restored = false var purchased = false @@ -446,7 +448,7 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac let error = transaction.error as NSError? if let error = error { - DDLogError("(PurchaseService) payment Queue error \(error.localizedDescription)") + LOG.error("Payment Queue error \(error.localizedDescription)") } if !allProducts.contains(transaction.payment.productIdentifier) { @@ -456,11 +458,11 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac switch transaction.transactionState { case .purchasing, .deferred: - DDLogInfo("(PurchaseService) Transaction deffered or purchasing for product: \(transaction.payment.productIdentifier)") + LOG.info("Transaction deffered or purchasing for product: \(transaction.payment.productIdentifier)") break case .failed: - DDLogInfo("(PurchaseService) Transaction failed for product: \(transaction.payment.productIdentifier)") + LOG.info("Transaction failed for product: \(transaction.payment.productIdentifier)") SKPaymentQueue.default().finishTransaction(transaction) if error?.code == SKError.paymentCancelled.rawValue { postNotification(PurchaseAssistant.kPSNotificationCanceled, nil) @@ -469,12 +471,12 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac postNotification(PurchaseAssistant.kPSNotificationPurchaseFailure, transaction.error) case .purchased: - DDLogInfo("(PurchaseService) Transaction purchased for product: \(transaction.payment.productIdentifier)") + LOG.info("Transaction purchased for product: \(transaction.payment.productIdentifier)") purchased = true SKPaymentQueue.default().finishTransaction(transaction) case .restored: - DDLogInfo("(PurchaseService) Transaction restored for product: \(transaction.payment.productIdentifier)") + LOG.info("Transaction restored for product: \(transaction.payment.productIdentifier)") restored = true SKPaymentQueue.default().finishTransaction(transaction) @@ -502,7 +504,7 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) { - DDLogInfo("(PurchaseService)productsRequest didReceive products count: \(response.products.count) ") + LOG.info("productsRequest didReceive products count: \(response.products.count) ") _atomicProductsToPurchase.mutate { $0.removeAll() } for product in response.products { @@ -520,7 +522,7 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac _atomicProductsToPurchase.mutate { $0.append(product) } } default: - DDLogError("(PurchaseService) productsRequest didReceive error. Unknown productId \(product.productIdentifier)") + LOG.error("productsRequest didReceive error. Unknown productId \(product.productIdentifier)") assertionFailure("Unknown productId \(product.productIdentifier)") } } @@ -532,13 +534,13 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac } func request(_ request: SKRequest, didFailWithError error: Error) { - DDLogError("(PurchaseServie) request did fail with error: \(error.localizedDescription)") + LOG.error("Request did fail with error: \(error.localizedDescription)") productRequest = nil } func paymentQueueRestoreCompletedTransactionsFinished(_ queue: SKPaymentQueue) { - DDLogInfo("(PurchaseServie) restore completed") + LOG.info("Restore completed") for transaction in queue.transactions { if allProducts.contains(transaction.payment.productIdentifier) { return @@ -551,7 +553,7 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac func paymentQueue(_ queue: SKPaymentQueue, restoreCompletedTransactionsFailedWithError error: Error) { - DDLogError("(PurchaseServie) restore failed with error: \(error.localizedDescription)") + LOG.error("Restore failed with error: \(error.localizedDescription)") let nsError = error as NSError if nsError.code == SKError.paymentCancelled.rawValue { postNotification(PurchaseAssistant.kPSNotificationCanceled, nil) @@ -568,10 +570,10 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac @discardableResult private func processLoginResult(_ error: Error?)->Bool { - DDLogInfo("(PurchaseService) processLoginResult") + LOG.info("processLoginResult") if error != nil { - DDLogError("(PurchaseService) processLoginResult error \(error!.localizedDescription)") + LOG.error("processLoginResult error \(error!.localizedDescription)") postNotification(PurchaseAssistant.kPSNotificationLoginFailure, error) return false } @@ -630,7 +632,7 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac resources.sharedDefaults().set(true, forKey: AEDefaultsNonConsumableItemPurchased) default: - DDLogInfo("(PurchaseService) processValidateResponse - error. Unknown product ID: \(productId)") + LOG.info("processValidateResponse - error. Unknown product ID: \(productId)") // It is not an error. There we can recieve old product identifiers if expirationDate == nil { @@ -690,7 +692,7 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac case .year: returnPeriodUnit = .year @unknown default: - DDLogError("(PurchaseService) getPeriod - unknown period") + LOG.error("getPeriod - unknown period") returnPeriodUnit = .day } @@ -723,7 +725,7 @@ final class PurchaseService: NSObject, PurchaseServiceProtocol, SKPaymentTransac } func updateSetappState(subscription: SetappSubscription) { - DDLogInfo("(PurchaseService) - updateSetappState; sub is active = \(subscription.isActive); saved state = \(resources.purchasedThroughSetapp)") + LOG.info("Sub is active = \(subscription.isActive); saved state = \(resources.purchasedThroughSetapp)") if (subscription.isActive && !resources.purchasedThroughSetapp) || !subscription.isActive && resources.purchasedThroughSetapp { diff --git a/AdguardExtension/AdguardApp/Services/SetappService.swift b/AdguardExtension/AdguardApp/Services/SetappService.swift index 89edd421c..8f4822752 100644 --- a/AdguardExtension/AdguardApp/Services/SetappService.swift +++ b/AdguardExtension/AdguardApp/Services/SetappService.swift @@ -18,6 +18,7 @@ import Foundation import Setapp +import SharedAdGuardSDK /** this service is responsible for managing the setapp license activation @@ -34,6 +35,8 @@ protocol SetappServiceProtocol { func openUrl(_ url: URL, options: [UIApplication.OpenURLOptionsKey : Any])->Bool } +private let LOG = LoggerFactory.getLoggerWrapper(SetappService.self) + class SetappService: SetappServiceProtocol, SetappManagerDelegate { private let purchaseService: PurchaseServiceProtocol @@ -46,14 +49,14 @@ class SetappService: SetappServiceProtocol, SetappManagerDelegate { self.purchaseService = purchaseService self.resources = resources - DDLogInfo("(SetappService) - init; setappUsed = \(resources.setappUsed )") + LOG.info("SetappService - init; setappUsed = \(resources.setappUsed )") if resources.setappUsed { purchaseService.updateSetappState(subscription: SetappManager.shared.subscription) } } func start() { - DDLogInfo("(SetappService) - starting Setapp; Current status = \(SetappManager.shared.subscription.description); setappUsed = \(resources.setappUsed)") + LOG.info("Starting Setapp; Current status = \(SetappManager.shared.subscription.description); setappUsed = \(resources.setappUsed)") if resources.setappUsed { startManager() } @@ -68,15 +71,15 @@ class SetappService: SetappServiceProtocol, SetappManagerDelegate { startManager() if SetappManager.shared.canOpen(url: url) { - DDLogInfo("(SetappService) - Setapp can openUrl; url: \(url)") + LOG.info("Setapp can openUrl; url: \(url)") return SetappManager.shared.open(url: url, options: options) { [weak self] result in switch result { case .success(let subscription): - DDLogInfo("Successfully logged in with setapp, current subscription: \(subscription.description)") + LOG.info("Successfully logged in with setapp, current subscription: \(subscription.description)") self?.resources.setappUsed = true case .failure(let error): - DDLogError("Error while logging in with setapp: \(error)") + LOG.error("Error while logging in with setapp: \(error)") if (error as NSError).code == self?.deviceLimitErrorCode { NotificationCenter.default.post(Notification(name: .setappDeviceLimitReched)) } @@ -91,8 +94,8 @@ class SetappService: SetappServiceProtocol, SetappManagerDelegate { // MARK: -- SetAppManagerDelegate func setappManager(_ manager: SetappManager, didUpdateSubscriptionTo newSetappSubscription: SetappSubscription) { - DDLogInfo("(SetappService) setapp subscription changed") - DDLogInfo("(SetappService) setapp new subscription is active: \(manager.subscription.isActive)") + LOG.info("Setapp subscription changed") + LOG.info("Setapp new subscription is active: \(manager.subscription.isActive)") purchaseService.updateSetappState(subscription: manager.subscription) resources.setappUsed = true @@ -101,7 +104,7 @@ class SetappService: SetappServiceProtocol, SetappManagerDelegate { // MARK: -- private methods private func startManager() { - DDLogInfo("(SetappService) - startManager; start = \(started)") + LOG.info("startManager; start = \(started)") if started { return @@ -112,7 +115,7 @@ class SetappService: SetappServiceProtocol, SetappManagerDelegate { SetappManager.shared.delegate = self SetappManager.setLogHandle { (message: String, logLevel: SetappLogLevel) in - DDLogInfo("(Setapp) [\(logLevel)], \(message)") + LOG.info("[\(logLevel)], \(message)") } started = true diff --git a/AdguardExtension/AdguardApp/Services/SettingsResetService.swift b/AdguardExtension/AdguardApp/Services/SettingsResetService.swift index 90a401ca0..6534dad25 100644 --- a/AdguardExtension/AdguardApp/Services/SettingsResetService.swift +++ b/AdguardExtension/AdguardApp/Services/SettingsResetService.swift @@ -18,6 +18,7 @@ import SafariAdGuardSDK import DnsAdGuardSDK +import SharedAdGuardSDK /// Protocol for reseting service protocol SettingsResetServiceProtocol: AnyObject { @@ -42,6 +43,8 @@ protocol SettingsResetServiceProtocol: AnyObject { // TODO: Need tests for this service +private let LOG = LoggerFactory.getLoggerWrapper(SettingsResetService.self) + /// Service reset safari protection, DNS protection, all in app statistics, providers, purchase info, resources, vpn manager final class SettingsResetService: SettingsResetServiceProtocol { @@ -102,7 +105,7 @@ final class SettingsResetService: SettingsResetServiceProtocol { workingQueue.async { [weak self] in guard let self = self else { return } - DDLogInfo("(SettingsResetService) - resetAllSettings; Start reset") + LOG.info("Start reset") // Reset Shared Defaults self.resources.reset() @@ -115,7 +118,7 @@ final class SettingsResetService: SettingsResetServiceProtocol { group.enter() self.safariProtection.reset(withReloadCB: false) { error in if let error = error { - DDLogError("(SettingsResetService) - resetAllSettings; Safari protection reset error: \(error)") + LOG.error("Safari protection reset error: \(error)") group.leave() return } @@ -169,7 +172,7 @@ final class SettingsResetService: SettingsResetServiceProtocol { if fromUI { DispatchQueue.main.async { AppDelegate.shared.setMainPageAsCurrentAndPopToRootControllersEverywhere() - DDLogInfo("(SettingsResetService) - resetAllSettings; Reseting is over") + LOG.info("Reseting is over") } } } @@ -181,26 +184,26 @@ final class SettingsResetService: SettingsResetServiceProtocol { func resetAllStatistics() { workingQueue.async { [weak self] in guard let self = self else { return } - DDLogInfo("(SettingsResetService) - resetStatistics; Start reset statistics") + LOG.info("Start reset statistics") let activityReset = self.resetActivityStatistics() let chartReset = self.resetChartStatistics() let dnsLogReset = self.resetDnsLogStatistics() - DDLogInfo("(SettingsResetService) - resetStatistics; Activity reset = \(activityReset); Chart reset = \(chartReset); DNS log reset = \(dnsLogReset)") + LOG.info("Activity reset = \(activityReset); Chart reset = \(chartReset); DNS log reset = \(dnsLogReset)") // Notify that settings were reset NotificationCenter.default.post(name: .resetStatistics, object: self) - DDLogInfo("(SettingsResetService) - resetStatistics; Reset statistics is over") + LOG.info("Reset statistics is over") } } func resetActivityStatistics() -> Bool { do { try activityStatistics.reset() - DDLogInfo("(SettingsResetService) - resetStatistics; Activity statistics reset successfully") + LOG.info("Activity statistics reset successfully") return true } catch { - DDLogError("(SettingsResetService) - resetStatistics; Error occurred while resetting activity statistics: \(error)") + LOG.error("Error occurred while resetting activity statistics: \(error)") return false } } @@ -208,11 +211,11 @@ final class SettingsResetService: SettingsResetServiceProtocol { func resetChartStatistics() -> Bool { do { try chartStatistics.reset() - DDLogInfo("(SettingsResetService) - resetStatistics; Chart statistics reset successfully") + LOG.info("Chart statistics reset successfully") return true } catch { - DDLogError("(SettingsResetService) - resetStatistics; Error occurred while resetting chart statistics: \(error)") + LOG.error("Error occurred while resetting chart statistics: \(error)") return false } } @@ -220,10 +223,10 @@ final class SettingsResetService: SettingsResetServiceProtocol { func resetDnsLogStatistics() -> Bool { do { try dnsLogStatistics.reset() - DDLogInfo("(SettingsResetService) - resetStatistics; Dns log statistics reset successfully") + LOG.info("Dns log statistics reset successfully") return true } catch { - DDLogError("(SettingsResetService) - resetStatistics; Error occurred while resetting dns log statistics: \(error)") + LOG.error("Error occurred while resetting dns log statistics: \(error)") return false } } @@ -233,18 +236,18 @@ final class SettingsResetService: SettingsResetServiceProtocol { private func resetDnsProtection() { do { try dnsProtection.reset() - DDLogInfo("(SettingsResetService) - resetDnsProtection; Dns Protection reset successfully") + LOG.info("Dns Protection reset successfully") } catch { - DDLogError("(SettingsResetService) - resetDnsProtection; Error occurred while resetting dns protection: \(error)") + LOG.error("Error occurred while resetting dns protection: \(error)") } } private func resetDnsProviderManager() { do { try dnsProvidersManager.reset() - DDLogInfo("(SettingsResetService) - resetDnsProviderManager; Dns provider manager reset successfully") + LOG.info("Dns provider manager reset successfully") } catch { - DDLogError("(SettingsResetService) - resetDnsProviderManager; Error occurred while resetting dns provider manager: \(error)") + LOG.error("Error occurred while resetting dns provider manager: \(error)") } } @@ -253,9 +256,9 @@ final class SettingsResetService: SettingsResetServiceProtocol { private func enablePredefinedFiltersAndGroups() { do { try safariProtection.enablePredefinedGroupsAndFilters() - DDLogInfo("(SettingsResetService) - enablePredefinedFiltersAndGroups; Successfully enable predefined filters and groups after reset safari protection") + LOG.info("Successfully enable predefined filters and groups after reset safari protection") } catch { - DDLogError("(SettingsResetService) - enablePredefinedFiltersAndGroups; Error occurred while enabling predefined filters and groups on safari protection reset") + LOG.error("Error occurred while enabling predefined filters and groups on safari protection reset") } } @@ -263,19 +266,19 @@ final class SettingsResetService: SettingsResetServiceProtocol { safariProtection.updateFiltersMetaAndLocalizations(true) { result in switch result { case .success(_): - DDLogInfo("(SettingsResetService) - updateSafariProtectionMeta; Safari protection meta successfully updated") + LOG.info("Safari protection meta successfully updated") case .error(let error): - DDLogError("(SettingsResetService) - updateSafariProtectionMeta; On update safari protection meta error occurred: \(error)") + LOG.error("On update safari protection meta error occurred: \(error)") } } onCbReloaded: { error in if let error = error { - DDLogError("(SettingsResetService) - updateSafariProtectionMeta; On reload CB error occurred: \(error)") + LOG.error("On reload CB error occurred: \(error)") return } - DDLogInfo("(SettingsResetService) - updateSafariProtectionMeta; Successfully reload CB") + LOG.info("Successfully reload CB") } } } diff --git a/AdguardExtension/AdguardApp/Services/StartupService.swift b/AdguardExtension/AdguardApp/Services/StartupService.swift index 49472f30b..09b56c653 100644 --- a/AdguardExtension/AdguardApp/Services/StartupService.swift +++ b/AdguardExtension/AdguardApp/Services/StartupService.swift @@ -18,6 +18,9 @@ import SafariAdGuardSDK import DnsAdGuardSDK +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(StartupService.self) /// This service initializes all shared services and puts them into ServiceLocator final class StartupService : NSObject { @@ -26,7 +29,7 @@ final class StartupService : NSObject { let locator = ServiceLocator.shared // init services - + let sharedResources: AESharedResourcesProtocol = AESharedResources() locator.addService(service: sharedResources) @@ -46,7 +49,11 @@ final class StartupService : NSObject { // init services let sharedResources: AESharedResourcesProtocol = locator.getService()! - + + let logManager: LoggerManager = LoggerManagerImpl(url: sharedResources.sharedLogsURL()) + locator.addService(service: logManager) + configureLogger(resources: sharedResources, manager: logManager) + let networkService = ACNNetworking() locator.addService(service: networkService) @@ -199,4 +206,22 @@ final class StartupService : NSObject { ) locator.addService(service: migrationService) } + + + + private static func configureLogger(resources: AESharedResourcesProtocol, manager: LoggerManager) { + #if DEBUG + manager.configure(.debug) + manager.configureDnsLibsLogLevel(.debug) + LOG.info("Logger configured with log level debug") + + #else + let sharedResource: AESharedResourcesProtocol = ServiceLocator.shared.getService()! + let logLevel: LogLevel = sharedResource.isDebugLogs ? .debug : .info + manager.configure(logLevel) + manager.configureDnsLibsLogLevel(logLevel) + LOG.info("Logger configured with log level \(logLevel)") + + #endif + } } diff --git a/AdguardExtension/AdguardApp/Services/UserNotificationService/UserNotificationService.swift b/AdguardExtension/AdguardApp/Services/UserNotificationService/UserNotificationService.swift index 7f2a1c793..27c107384 100644 --- a/AdguardExtension/AdguardApp/Services/UserNotificationService/UserNotificationService.swift +++ b/AdguardExtension/AdguardApp/Services/UserNotificationService/UserNotificationService.swift @@ -18,6 +18,7 @@ import Foundation import UserNotifications +import SharedAdGuardSDK // Must support NSSecureCoding thus it is Int enum PushNotificationCommands: Int { @@ -50,6 +51,8 @@ protocol UserNotificationServiceProtocol { func postNotificationInForeground(body: String, title: String) } +private let LOG = LoggerFactory.getLoggerWrapper(UserNotificationService.self) + class UserNotificationService: NSObject, UserNotificationServiceProtocol, UNUserNotificationCenterDelegate { @objc static let notificationBody = "notificationBody" @@ -156,7 +159,7 @@ class UserNotificationService: NSObject, UserNotificationServiceProtocol, UNUser center.add(request) { (error) in if let error = error { - DDLogError("(UserNotificationService) - alertNotification error : \(error)") + LOG.error("alertNotification error : \(error)") } } } diff --git a/AdguardExtension/AdguardApp/Services/Utils/URL+CustomSchemeURLParserProtocol.swift b/AdguardExtension/AdguardApp/Services/Utils/URL+CustomSchemeURLParserProtocol.swift index 4b280bc12..c3e720123 100644 --- a/AdguardExtension/AdguardApp/Services/Utils/URL+CustomSchemeURLParserProtocol.swift +++ b/AdguardExtension/AdguardApp/Services/Utils/URL+CustomSchemeURLParserProtocol.swift @@ -17,6 +17,7 @@ // import Foundation +import SharedAdGuardSDK protocol CustomSchemeURLParserProtocol { func parseAuthUrl() -> URLParserResult @@ -28,6 +29,8 @@ struct URLParserResult { var params: [String: String]? } +private let LOG = LoggerFactory.getLoggerWrapper(URL.self) + extension URL: CustomSchemeURLParserProtocol { func protectionStateIsEnabled() -> Bool? { @@ -58,7 +61,7 @@ extension URL: CustomSchemeURLParserProtocol { private func splitURLByChar(separator: Character) -> [String]? { let components = self.absoluteString.split(separator: separator, maxSplits: 1) if components.count != 2 { - DDLogError("(CustomSchemeURLPareser) parseCustomUrlScheme error - unsupported url format") + LOG.error("parseCustomUrlScheme error - unsupported url format") return nil } return components.compactMap { String($0) } @@ -85,7 +88,7 @@ extension URL: CustomSchemeURLParserProtocol { return URLParserResult(command: command, params: params) } - DDLogError("(CustomSchemeURLPareser) parseCustomUrlScheme error - unsupported url format") + LOG.error("parseCustomUrlScheme error - unsupported url format") return URLParserResult() } } diff --git a/AdguardExtension/AdguardApp/Services/VpnConfigurationStatus.swift b/AdguardExtension/AdguardApp/Services/VpnConfigurationStatus.swift index e284c79f8..7e4fa7b6b 100644 --- a/AdguardExtension/AdguardApp/Services/VpnConfigurationStatus.swift +++ b/AdguardExtension/AdguardApp/Services/VpnConfigurationStatus.swift @@ -17,6 +17,9 @@ // import NetworkExtension +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(VpnConfigurationState.self) enum VpnConfigurationState: CustomStringConvertible { case enabled, connecting, disconnecting, disabled @@ -39,7 +42,7 @@ enum VpnConfigurationState: CustomStringConvertible { case .invalid: self = .disabled case .reasserting: self = .connecting @unknown default: - DDLogError("Unknown NEVPNStatus case") + LOG.error("Unknown NEVPNStatus case") self = .disabled } } diff --git a/AdguardExtension/AdguardApp/Services/VpnManager.swift b/AdguardExtension/AdguardApp/Services/VpnManager.swift index 423fd1382..be7252fe0 100644 --- a/AdguardExtension/AdguardApp/Services/VpnManager.swift +++ b/AdguardExtension/AdguardApp/Services/VpnManager.swift @@ -18,6 +18,7 @@ import Foundation import NetworkExtension +import SharedAdGuardSDK @objc protocol VpnManagerProtocol { @@ -47,6 +48,8 @@ enum VpnManagerError: Error { case managerNotInstalled } +private let LOG = LoggerFactory.getLoggerWrapper(VpnManager.self) + class VpnManager: VpnManagerProtocol { static let configurationRemovedNotification = NSNotification.Name("configurationRemovedNotification") @@ -91,7 +94,7 @@ class VpnManager: VpnManagerProtocol { guard let self = self else { return } guard let session = note.object as? NETunnelProviderSession else { - DDLogError("Invalid note when vpn status received") + LOG.error("Invalid note when vpn status received") return } let vpnStatus = session.status @@ -131,7 +134,7 @@ class VpnManager: VpnManagerProtocol { // MARK: - VpnManagerProtocol methods func checkVpnInstalled(completion: @escaping (Error?)->Void) { - DDLogInfo("(VpnManager) checkVpnInstalled called") + LOG.info("checkVpnInstalled called") workingQueue.async { [weak self] in guard let self = self else { return } @@ -148,7 +151,7 @@ class VpnManager: VpnManagerProtocol { } func updateSettings(completion: ((Error?) -> Void)?) { - DDLogInfo("(VpnManager) updateSettings called waiting for 1 second before restart") + LOG.info("updateSettings called waiting for 1 second before restart") /* There was a problem when user could produce lots of VPN restarts in a row. To avoid multiple restarts for every user action we wait for 1 second for next restart, if there weren't any than we restart it. Issue link: https://github.com/AdguardTeam/AdguardForiOS/issues/1719 @@ -169,7 +172,7 @@ class VpnManager: VpnManagerProtocol { self?.updateSettingsCallback = completion self?.timer = Timer.scheduledTimer(withTimeInterval: 1, repeats: false, block: { _ in - DDLogInfo("(VpnManager) 1 second passed calling updateSettings now") + LOG.info("1 second passed calling updateSettings now") self?.updateSettingsInternal { error in DispatchQueue.main.async { self?.timer?.invalidate() @@ -183,7 +186,7 @@ class VpnManager: VpnManagerProtocol { } func removeVpnConfiguration(completion: @escaping (Error?) -> Void) { - DDLogInfo("(VpnManager) removeVpnConfiguration called") + LOG.info("removeVpnConfiguration called") workingQueue.async { [weak self] in guard let self = self else { return } @@ -206,7 +209,7 @@ class VpnManager: VpnManagerProtocol { func installVpnConfiguration(completion: @escaping (Error?) -> Void) { - DDLogInfo("(VpnManager) installVpnConfiguration") + LOG.info("installVpnConfiguration") workingQueue.async { [weak self] in guard let self = self else { return } @@ -233,7 +236,7 @@ class VpnManager: VpnManagerProtocol { } func getConfigurationStatus(callback: @escaping (VpnConfigurationStatus) -> Void) { - DDLogInfo("(VpnManager) getConfigurationStatus called") + LOG.info("getConfigurationStatus called") workingQueue.async { [weak self] in guard let self = self else { return } @@ -250,7 +253,7 @@ class VpnManager: VpnManagerProtocol { workingQueue.async { [weak self] in guard let self = self else { return } - DDLogInfo("(VpnManager) updateSettings") + LOG.info("updateSettings") let (manager, error) = self.loadManager() @@ -260,7 +263,7 @@ class VpnManager: VpnManagerProtocol { } if manager == nil { - DDLogError("(VpnManager) updateSettings error - there is no installed vpn configurations to update") + LOG.error("There is no installed vpn configurations to update") let error = VpnManagerError.managerNotInstalled completion?(error) @@ -277,7 +280,7 @@ class VpnManager: VpnManagerProtocol { } private func loadManager()->(NETunnelProviderManager?, Error?) { - DDLogInfo("(VpnManager) loadManager ") + LOG.info("loadManager ") var manager: NETunnelProviderManager? var resultError: Error? @@ -291,17 +294,17 @@ class VpnManager: VpnManagerProtocol { guard let self = self else { return } if error != nil { resultError = error - DDLogError("(VpnManager) loadManager error: \(error!)") + LOG.error("loadManager error: \(error!)") return } if managers?.count ?? 0 == 0 { - DDLogInfo("(VpnManager) loadManager - manager not installed") + LOG.info("loadManager - manager not installed") return } if managers!.count > 1 { - DDLogError("(VpnManager) loadManager error - there are \(managers!.count) managers installed. Delete all managers") + LOG.error("loadManager error - there are \(managers!.count) managers installed. Delete all managers") for manager in managers! { _ = self.removeManager(manager) @@ -312,7 +315,7 @@ class VpnManager: VpnManagerProtocol { return } - DDLogInfo("(VpnManager) loadManager success)") + LOG.info("loadManager success)") manager = managers?.first } @@ -324,7 +327,7 @@ class VpnManager: VpnManagerProtocol { private func createManager()->NETunnelProviderManager { - DDLogInfo("(VpnManager) createManager") + LOG.info("createManager") let manager = providerManagerType.self.init() @@ -332,7 +335,7 @@ class VpnManager: VpnManagerProtocol { } private func setupConfiguration(_ manager: NETunnelProviderManager) { - DDLogInfo("(VpnManager) setupConfiguration called") + LOG.info("setupConfiguration called") // do not update configuration for not premium users if !appConfiguration.proStatus { @@ -359,7 +362,7 @@ class VpnManager: VpnManagerProtocol { } if resources.dnsImplementation == .native { - DDLogInfo("(VpnManager) set manager isEnabled = false because native mode is enabled ") + LOG.info("Set manager isEnabled = false because native mode is enabled ") } manager.isEnabled = resources.dnsImplementation == .native ? false : enabled @@ -370,7 +373,7 @@ class VpnManager: VpnManagerProtocol { private func saveManager(_ manager: NETunnelProviderManager)->Error? { - DDLogInfo("(VpnManager) saveManager") + LOG.info("saveManager") var resultError: Error? let group = DispatchGroup() @@ -379,10 +382,10 @@ class VpnManager: VpnManagerProtocol { manager.saveToPreferences { (error) in resultError = error if error != nil { - DDLogError("(VpnManager) saveManager error: \(error!)") + LOG.error("saveManager error: \(error!)") } else { - DDLogInfo("(VpnManager) saveManager success") + LOG.info("saveManager success") } group.leave() @@ -394,7 +397,7 @@ class VpnManager: VpnManagerProtocol { } private func removeManager(_ manager: NETunnelProviderManager)->Error? { - DDLogInfo("(VpnManager) - removeManager called") + LOG.info("removeManager called") var resultError: Error? let group = DispatchGroup() @@ -411,15 +414,15 @@ class VpnManager: VpnManagerProtocol { } private func restartTunnel(_ manager: NETunnelProviderManager) { - DDLogInfo("(VpnManager) - restartTunnel called") + LOG.info("restartTunnel called") // Assigning start tunnel function to call it in observer startTunnel = { - DDLogInfo("(VpnManager) - Trying to start VPN tunnel after restart") + LOG.info("Trying to start VPN tunnel after restart") do { try manager.connection.startVPNTunnel() } catch { - DDLogError("(VpnManager) - start tunnel error: \(error.localizedDescription)") + LOG.error("startTunnel error: \(error.localizedDescription)") } } manager.connection.stopVPNTunnel() @@ -436,10 +439,10 @@ class VpnManager: VpnManagerProtocol { actualEnabled = manager.connection.status == .connected || manager.connection.status == .connecting } - DDLogInfo("(VpnManager) savedState: \(savedEnabled) actual: \(actualEnabled)") + LOG.info("savedState: \(savedEnabled) actual: \(actualEnabled)") if actualEnabled != savedEnabled { - DDLogInfo("(VpnManager) vpn enabled state was changed outside the application to state: \(actualEnabled)") + LOG.info("Vpn enabled state was changed outside the application to state: \(actualEnabled)") NotificationCenter.default.post(name:VpnManager.stateChangedNotification, object: actualEnabled) } } diff --git a/AdguardExtension/AdguardApp/UI/Utils/AdGuardVpnIntegration/UIApplication+AdGuardVpn.swift b/AdguardExtension/AdguardApp/UI/Utils/AdGuardVpnIntegration/UIApplication+AdGuardVpn.swift index 33964f38e..591a80ad4 100644 --- a/AdguardExtension/AdguardApp/UI/Utils/AdGuardVpnIntegration/UIApplication+AdGuardVpn.swift +++ b/AdguardExtension/AdguardApp/UI/Utils/AdGuardVpnIntegration/UIApplication+AdGuardVpn.swift @@ -17,6 +17,9 @@ // import UIKit +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(UIApplication.self) extension UIApplication { @@ -61,7 +64,7 @@ extension UIApplication { static func openAdGuardVpnAppIfInstalled() { let appUrl = URL(string: "\(adguardVpnScheme)://")! if shared.canOpenURL(appUrl) { - DDLogInfo("AdGuard VPN is installed, open it now") + LOG.info("AdGuard VPN is installed, open it now") shared.open(appUrl) } } diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/BottomAlertController/BottomAlertTransition.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/BottomAlertController/BottomAlertTransition.swift index 5f8fa71e5..f00b65300 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/BottomAlertController/BottomAlertTransition.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/BottomAlertController/BottomAlertTransition.swift @@ -18,6 +18,9 @@ import Foundation import UIKit +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(BottomAlertPresentingTransition.self) class BottomAlertPresentingTransition: NSObject, UIViewControllerAnimatedTransitioning { @@ -39,7 +42,7 @@ class BottomAlertPresentingTransition: NSObject, UIViewControllerAnimatedTransit let bottomConstraint = toVc.keyboardHeightLayoutConstraint, let toView = toVc.view else { - DDLogError("Animation without Content view") + LOG.error("Animation without Content view") return } diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/FilterDetailsViewController/FilterDetailsViewController.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/FilterDetailsViewController/FilterDetailsViewController.swift index f8abcd368..27f24912e 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/FilterDetailsViewController/FilterDetailsViewController.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/FilterDetailsViewController/FilterDetailsViewController.swift @@ -25,6 +25,8 @@ protocol FilterDetailsViewControllerDelegate: NewCustomFilterDetailsControllerDe func setFilter(with groupId: Int?, filterId: Int, enabled: Bool) throws -> FilterDetailsProtocol } +private let LOG = LoggerFactory.getLoggerWrapper(FilterDetailsViewController.self) + final class FilterDetailsViewController: UIViewController { // MARK: - UI Elements @@ -140,7 +142,7 @@ final class FilterDetailsViewController: UIViewController { } } catch { - DDLogError("(FilterDetailsViewController) - deleteButtonTapped; Error deleting custom filter with id=\(filterMeta.filterId); Error: \(error)") + LOG.error("Error deleting custom filter with id=\(filterMeta.filterId); Error: \(error)") showUnknownErrorAlert() } } @@ -165,7 +167,7 @@ extension FilterDetailsViewController: SwitchTableViewCellDelegate { filterMeta = newFilterMeta } catch { - DDLogError("(FilterDetailsViewController) - switchStateChanged; Error changing state for filter with id=\(filterMeta.filterId), group id=\(filterMeta.groupId.debugDescription); Error: \(error)") + LOG.error("Error changing state for filter with id=\(filterMeta.filterId), group id=\(filterMeta.groupId.debugDescription); Error: \(error)") showUnknownErrorAlert() } } diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/Activity/ActivityViewController/ActivityViewController.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/Activity/ActivityViewController/ActivityViewController.swift index 61436a3c5..255970b2b 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/Activity/ActivityViewController/ActivityViewController.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/Activity/ActivityViewController/ActivityViewController.swift @@ -18,12 +18,15 @@ import UIKit import DnsAdGuardSDK +import SharedAdGuardSDK protocol ActivityViewControllerDelegate: AnyObject { func hideTitle() func showTitle() } +private let LOG = LoggerFactory.getLoggerWrapper(ActivityViewController.self) + final class ActivityViewController: UITableViewController { // MARK: - Outlets @@ -321,7 +324,7 @@ final class ActivityViewController: UITableViewController { alert.dismiss(animated: true, completion: nil) self?.requestsModel?.clearRecords() let resetResult = self?.settingsReset.resetDnsLogStatistics() - DDLogInfo("(ActivityViewController) - showResetAlert; DNS log statistics reseted successfully = \(resetResult ?? false)") + LOG.info("DNS log statistics reseted successfully = \(resetResult ?? false)") } alert.addAction(yesAction) diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/ComplexProtectionController.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/ComplexProtectionController.swift index b44993d50..3c245bbdd 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/ComplexProtectionController.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/ComplexProtectionController.swift @@ -18,6 +18,9 @@ import UIKit import SafariAdGuardSDK +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(ComplexProtectionController.self) final class ComplexProtectionController: UITableViewController { @@ -183,7 +186,7 @@ final class ComplexProtectionController: UITableViewController { if resources.dnsImplementation == .native { if #available(iOS 14.0, *), complexProtection.systemProtectionEnabled { nativeDnsManager.removeDnsConfig { error in - DDLogError("Error removing dns manager: \(error.debugDescription)") + LOG.error("Error removing dns manager: \(error.debugDescription)") DispatchQueue.main.async { [weak self] in sender.isOn = self?.complexProtection.systemProtectionEnabled ?? false } @@ -192,7 +195,7 @@ final class ComplexProtectionController: UITableViewController { sender.isOn = complexProtection.systemProtectionEnabled nativeDnsManager.saveDnsConfig { error in if let error = error { - DDLogError("Received error when turning system protection on; Error: \(error.localizedDescription)") + LOG.error("Received error when turning system protection on; Error: \(error.localizedDescription)") } DispatchQueue.main.async { AppDelegate.shared.presentHowToSetupController() diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/DnsSettings/DnsProviderDetails/DnsProviderDetailsController.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/DnsSettings/DnsProviderDetails/DnsProviderDetailsController.swift index 2c24b4daa..5cd33fa36 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/DnsSettings/DnsProviderDetails/DnsProviderDetailsController.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/DnsSettings/DnsProviderDetails/DnsProviderDetailsController.swift @@ -18,6 +18,7 @@ import SafariServices import DnsAdGuardSDK +import SharedAdGuardSDK /// Delegate for DnsProvidersController protocol DnsProviderDetailsControllerDelegate: AnyObject { @@ -25,6 +26,8 @@ protocol DnsProviderDetailsControllerDelegate: AnyObject { func providerSelected() } +private let LOG = LoggerFactory.getLoggerWrapper(DnsProtectionUserRulesMigrationHelper.self) + /// Details controller that represent info about provider final class DnsProviderDetailsController : UITableViewController { @@ -173,7 +176,7 @@ final class DnsProviderDetailsController : UITableViewController { delegate?.providerSelected() navigationController?.popViewController(animated: true) } catch { - DDLogError("(DnsProviderDetailsController) - selectTapped; While selecting provider error occurred: \(error)") + LOG.error("While selecting provider error occurred: \(error)") showUnknownErrorAlert() } } @@ -244,7 +247,7 @@ extension DnsProviderDetailsController: SelectDnsProtocolControllerDelegate { try model.selectProviderWith(dnsProtocol: dnsProtocol) tableView.reloadData() } catch { - DDLogError("(DnsProviderDetailsController) - protocolSelected; While selecting protocol error occurred: \(error)") + LOG.error("While selecting protocol error occurred: \(error)") showUnknownErrorAlert() } } diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/DnsSettings/DnsSettingsController.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/DnsSettings/DnsSettingsController.swift index 69538bbe6..b58abbfc9 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/DnsSettings/DnsSettingsController.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/DnsSettings/DnsSettingsController.swift @@ -18,6 +18,9 @@ import UIKit import DnsAdGuardSDK +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(DnsSettingsController.self) final class DnsSettingsController : UITableViewController { @@ -240,7 +243,7 @@ final class DnsSettingsController : UITableViewController { if resources.dnsImplementation == .native { if #available(iOS 14.0, *), complexProtection.systemProtectionEnabled { nativeDnsManager.removeDnsConfig { error in - DDLogError("Error removing dns manager: \(error.debugDescription)") + LOG.error("Error removing dns manager: \(error.debugDescription)") DispatchQueue.main.async { [weak self] in sender.isOn = self?.complexProtection.systemProtectionEnabled ?? false } @@ -249,7 +252,7 @@ final class DnsSettingsController : UITableViewController { sender.isOn = complexProtection.systemProtectionEnabled nativeDnsManager.saveDnsConfig { error in if let error = error { - DDLogError("Received error when turning system protection on; Error: \(error.localizedDescription)") + LOG.error("Received error when turning system protection on; Error: \(error.localizedDescription)") } DispatchQueue.main.async { AppDelegate.shared.presentHowToSetupController() diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/Filters/AddNewCustomFilter/AddCustomFilterController.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/Filters/AddNewCustomFilter/AddCustomFilterController.swift index 059dea084..e8bb26b94 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/Filters/AddNewCustomFilter/AddCustomFilterController.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/Filters/AddNewCustomFilter/AddCustomFilterController.swift @@ -25,6 +25,8 @@ enum NewFilterType { case safariCustom, dnsCustom } +private let LOG = LoggerFactory.getLoggerWrapper(AddCustomFilterController.self) + final class AddCustomFilterController: BottomAlertController { var type: NewFilterType = .safariCustom @@ -142,13 +144,13 @@ final class AddCustomFilterController: BottomAlertController { let parser = CustomFilterMetaParser() do { let meta = try parser.getMetaFrom(url: url, for: .safari) - DDLogInfo("(AddCustomFilterController) - parse URL; Successfully get meta from url: \(url)") + LOG.info("Parse URL; Successfully get meta from url: \(url)") DispatchQueue.main.async { completion() self?.presentNewCustomFilterDetailsController(meta) } } catch { - DDLogError("(AddCustomFilterController) - parse URL; Failed to get meta from url: \(url); Error: \(error)") + LOG.error("Parse URL; Failed to get meta from url: \(url); Error: \(error)") DispatchQueue.main.async { completion() let errorMessage = String.localizedString("add_custom_filter_error_message") diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/Filters/AddNewCustomFilter/NewCustomFilterDetailsController.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/Filters/AddNewCustomFilter/NewCustomFilterDetailsController.swift index 62e345ceb..54b88f4cc 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/Filters/AddNewCustomFilter/NewCustomFilterDetailsController.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/ComplexProtection/Filters/AddNewCustomFilter/NewCustomFilterDetailsController.swift @@ -42,6 +42,8 @@ struct EditCustomFilterModel { let homePage: String? } +private let LOG = LoggerFactory.getLoggerWrapper(NewCustomFilterDetailsController.self) + final class NewCustomFilterDetailsController: BottomAlertController { var newFilterModel: NewCustomFilterModel? @@ -164,7 +166,7 @@ final class NewCustomFilterDetailsController: BottomAlertController { ) delegate?.addCustomFilter(meta) { [weak self] error in if let error = error { - DDLogError("(NewCustomFilterDetailsController) - addCustomFilter; Error adding custom filter to DB; Error: \(error)") + LOG.error("Error adding custom filter to DB; Error: \(error)") self?.showUnknownErrorAlert() self?.addButton.isEnabled = true return @@ -186,7 +188,7 @@ final class NewCustomFilterDetailsController: BottomAlertController { addButton.isEnabled = true dismiss(animated: true) } catch { - DDLogError("(NewCustomFilterDetailsController) - addAction; Error renaming filter; Error: \(error)") + LOG.error("Error renaming filter; Error: \(error)") showUnknownErrorAlert() } } diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/BugReportController.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/BugReportController.swift index 4f52f90ca..9fed83cf3 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/BugReportController.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/BugReportController.swift @@ -17,6 +17,9 @@ // import UIKit +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(BugReportController.self) final class BugReportController: UIViewController { @@ -95,7 +98,7 @@ final class BugReportController: UIViewController { } guard isValidEmail && isValidDescription else { - DDLogDebug("Mail: \(email); description: \(description)") + LOG.debug("Mail: \(email); description: \(description)") sendButton.stopIndicator() sendButton.isEnabled = true return diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/License/SignInFailureHandler.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/License/SignInFailureHandler.swift index d87916b1e..593a7abd9 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/License/SignInFailureHandler.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/License/SignInFailureHandler.swift @@ -17,12 +17,15 @@ // import Foundation +import SharedAdGuardSDK protocol SignInFailureHandlerProtocol { typealias SignInMessages = (errorMessage: String?, alertMessage: String?)? func loginFailure(_ error: NSError?, auth2Fa: (() -> ())? ) -> SignInMessages } +private let LOG = LoggerFactory.getLoggerWrapper(SignInFailureHandler.self) + struct SignInFailureHandler: SignInFailureHandlerProtocol { private let notificationService: UserNotificationServiceProtocol @@ -35,7 +38,7 @@ struct SignInFailureHandler: SignInFailureHandlerProtocol { if error == nil || error?.domain != LoginService.loginErrorDomain { // unknown error let errorDescription = error?.localizedDescription ?? "nil" - DDLogError("(LoginController) processLoginResponse - unknown error: \(errorDescription)") + LOG.error("processLoginResponse - unknown error: \(errorDescription)") let message = String.localizedString("login_error_message") notificationService.postNotificationInForeground(body: message, title: "") diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/ListOfRules/RuleDetailsController.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/ListOfRules/RuleDetailsController.swift index e99f9e101..859d52e0b 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/ListOfRules/RuleDetailsController.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/ListOfRules/RuleDetailsController.swift @@ -25,6 +25,8 @@ protocol RuleDetailsControllerDelegate { func modifyRule(_ oldRuleText: String, newRule: UserRule, at indexPath: IndexPath) throws } +private let LOG = LoggerFactory.getLoggerWrapper(RuleDetailsController.self) + final class RuleDetailsController: BottomAlertController, UITextViewDelegate { struct Context { @@ -117,7 +119,7 @@ final class RuleDetailsController: BottomAlertController, UITextViewDelegate { dismiss(animated: true, completion: nil) } catch { - DDLogError("(RuleDetailsController) - removeAction; Error removing rule: \(error)") + LOG.error("Error removing rule: \(error)") showUnknownErrorAlert() } } diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/Settings/AdvancedSettingsController.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/Settings/AdvancedSettingsController.swift index 39f769c1c..cec9f9072 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/Settings/AdvancedSettingsController.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/Settings/AdvancedSettingsController.swift @@ -19,6 +19,9 @@ import UIKit import SafariAdGuardSDK import AGDnsProxy +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(AdvancedSettingsController.self) final class AdvancedSettingsController: UITableViewController { @@ -75,11 +78,15 @@ final class AdvancedSettingsController: UITableViewController { } @IBAction func debugLogsAction(_ sender: UISwitch) { + let manager: LoggerManager = ServiceLocator.shared.getService()! + let isDebugLogs = sender.isOn resources.isDebugLogs = isDebugLogs - DDLogInfo("Log level changed to \(isDebugLogs ? "DEBUG" : "Normal")") - ACLLogger.singleton()?.logLevel = isDebugLogs ? ACLLDebugLevel : ACLLDefaultLevel - AGLogger.setLevel(isDebugLogs ? .AGLL_TRACE : .AGLL_INFO) + let logLevel: LogLevel = resources.isDebugLogs ? .debug : .info + manager.configure(logLevel) + manager.configureDnsLibsLogLevel(logLevel) + LOG.info("Log level switched to \(logLevel)") + dnsConfigAssistant.applyDnsPreferences(for: .modifiedAdvancedSettings, completion: nil) // restart tunnel to apply new log level } @@ -148,10 +155,10 @@ final class AdvancedSettingsController: UITableViewController { guard let self = self else { return } self.vpnManager.removeVpnConfiguration {(error) in DispatchQueue.main.async { - DDLogInfo("AdvancedSettingsController - removing VPN profile") + LOG.info("AdvancedSettingsController - removing VPN profile") if error != nil { ACSSystemUtils.showSimpleAlert(for: self, withTitle: String.localizedString("remove_vpn_profile_error_title"), message: String.localizedString("remove_vpn_profile_error_message")) - DDLogError("AdvancedSettingsController - error removing VPN profile") + LOG.error("AdvancedSettingsController - error removing VPN profile") } } } diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/Settings/LowLevelSettings/UpstreamsController.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/Settings/LowLevelSettings/UpstreamsController.swift index d131628d9..c0fbd7084 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/Settings/LowLevelSettings/UpstreamsController.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/Settings/LowLevelSettings/UpstreamsController.swift @@ -25,6 +25,8 @@ protocol UpstreamsControllerDelegate: AnyObject { func updateDescriptionLabel(type: UpstreamType, text: String) } +private let LOG = LoggerFactory.getLoggerWrapper(UpstreamsController.self) + final class UpstreamsController: BottomAlertController { @IBOutlet weak var upstreamTypeLabel: ThemableLabel! @IBOutlet weak var textFieldDesciptionLabel: ThemableLabel! @@ -84,7 +86,7 @@ final class UpstreamsController: BottomAlertController { let validAddresses = addresses.filter { UrlUtils.isIpv4($0) || UrlUtils.isIpv6($0) } if validAddresses.count != addresses.count && !text.isEmpty { - DDLogError("(UpstreamsController) saveAction error - invalid addresses)") + LOG.error("saveAction error - invalid addresses)") let messsage = type == .customAddress ? String.localizedString("invalid_ip_message") : String.localizedString("invalid_upstream_message") ACSSystemUtils.showSimpleAlert(for: self, withTitle: String.localizedString("common_error_title"), message: messsage) return @@ -195,7 +197,7 @@ final class UpstreamsController: BottomAlertController { } else { let message = errors.first - DDLogError("(UppstreamsController) saveAction error - \(message?.localizedDescription ?? "nil" )") + LOG.error("saveAction error - \(message?.localizedDescription ?? "nil" )") ACSSystemUtils.showSimpleAlert(for: self, withTitle: String.localizedString("common_error_title"), message: String.localizedString("invalid_upstream_message")) } } diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/SupportTableViewController.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/SupportTableViewController.swift index 67e30b479..8e453cf72 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/SupportTableViewController.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainMenu/SupportTableViewController.swift @@ -17,6 +17,9 @@ // import UIKit +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(SupportTableViewController.self) class SupportTableViewController: UITableViewController { @@ -114,7 +117,7 @@ class SupportTableViewController: UITableViewController { do { zipLog = try support.exportLogs() } catch { - DDLogError("(SupportTableViewController) - exportLogsTapped; On export zip file error occurred: \(error)") + LOG.error("On export zip file error occurred: \(error)") showUnknownErrorAlert() } guard let zipLog = zipLog else { @@ -125,7 +128,7 @@ class SupportTableViewController: UITableViewController { let activityVC = UIActivityViewController(activityItems: [zipLog] as [Any], applicationActivities: nil) activityVC.completionWithItemsHandler = {[weak self] _, _, _, error in if let error = error { - DDLogError("Error exporting logs: \(error)") + LOG.error("Error exporting logs: \(error)") } self?.support.deleteLogsFiles() } diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/ImportSettings/ImportSettingsController.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/ImportSettings/ImportSettingsController.swift index bc1225dca..04472d677 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/ImportSettings/ImportSettingsController.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/ImportSettings/ImportSettingsController.swift @@ -18,6 +18,9 @@ import DnsAdGuardSDK import SafariAdGuardSDK +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(ImportSettingsController.self) final class ImportSettingsController: BottomAlertController { @@ -116,12 +119,12 @@ extension ImportSettingsController: UITableViewDataSource { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let cell = tableView.dequeueReusableCell(withIdentifier: "ImportSettingsCell") as? ImportSettingsCell else { - DDLogError("can not instantiate ImportSettingsCell") + LOG.error("Can not instantiate ImportSettingsCell") return UITableViewCell() } guard let row = model?.rows[indexPath.row] else { - DDLogError("can not find row at index: \(indexPath.row)") + LOG.error("Can not find row at index: \(indexPath.row)") return UITableViewCell() } diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/ImportSettings/ImportSettingsViewModel.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/ImportSettings/ImportSettingsViewModel.swift index 462b130eb..329a49357 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/ImportSettings/ImportSettingsViewModel.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/ImportSettings/ImportSettingsViewModel.swift @@ -18,6 +18,7 @@ import SafariAdGuardSDK import DnsAdGuardSDK +import SharedAdGuardSDK enum ImportRowType { case cbFilter @@ -63,6 +64,8 @@ protocol ImportSettingsViewModelProtocol { func applySettings(callback: @escaping ()->Void) } +private let LOG = LoggerFactory.getLoggerWrapper(ImportSettingsViewModel.self) + class ImportSettingsViewModel: ImportSettingsViewModelProtocol { var rows: [SettingRow] @@ -248,7 +251,7 @@ class ImportSettingsViewModel: ImportSettingsViewModelProtocol { row.title = String(format: format, name) } else { - DDLogError("unknown filter") + LOG.error("Unknown filter") } row.imported = imported diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/MainPageController.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/MainPageController.swift index 8616430e7..4ad7df225 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/MainPageController.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/MainPageController.swift @@ -21,6 +21,8 @@ import SharedAdGuardSDK import SafariAdGuardSDK import DnsAdGuardSDK +private let LOG = LoggerFactory.getLoggerWrapper(MainPageController.self) + final class MainPageController: UIViewController, DateTypeChangedProtocol, ComplexSwitchDelegate, OnboardingControllerDelegate, LicensePageViewControllerDelegate, MainPageModelDelegate { var ready = false @@ -311,13 +313,13 @@ final class MainPageController: UIViewController, DateTypeChangedProtocol, Compl if systemProtectionButton.buttonIsOn { if #available(iOS 14.0, *) { nativeDnsManager.removeDnsConfig { error in - DDLogError("Error removing dns manager: \(error.debugDescription)") + LOG.error("Error removing dns manager: \(error.debugDescription)") } } } else if #available(iOS 14.0, *) { nativeDnsManager.saveDnsConfig { error in if let error = error { - DDLogError("Received error when turning system protection on; Error: \(error.localizedDescription)") + LOG.error("Received error when turning system protection on; Error: \(error.localizedDescription)") } DispatchQueue.main.async { AppDelegate.shared.presentHowToSetupController() @@ -722,7 +724,7 @@ final class MainPageController: UIViewController, DateTypeChangedProtocol, Compl and updates UI */ private func observeContentBlockersState() { - DDLogInfo("Content blockers states changed; allContentBlockersEnabled = \(configuration.allContentBlockersEnabled)") + LOG.info("Content blockers states changed; allContentBlockersEnabled = \(configuration.allContentBlockersEnabled)") if configuration.allContentBlockersEnabled { hideContentBlockersInfo() } else { @@ -731,7 +733,7 @@ final class MainPageController: UIViewController, DateTypeChangedProtocol, Compl let onboardingShown = resources.sharedDefaults().bool(forKey: OnboardingWasShown) - DDLogInfo("Content blockers states changed; onboardingShown = \(onboardingShown); onBoardingIsInProcess = \(onBoardingIsInProcess)") + LOG.info("Content blockers states changed; onboardingShown = \(onboardingShown); onBoardingIsInProcess = \(onBoardingIsInProcess)") if !onBoardingIsInProcess { if !onboardingShown { configuration.showStatusBar = false @@ -910,7 +912,7 @@ final class MainPageController: UIViewController, DateTypeChangedProtocol, Compl let storyboard = UIStoryboard(name: "ImportSettings", bundle: nil) guard let importController = storyboard.instantiateViewController(withIdentifier: "ImportSettingsController") as? ImportSettingsController else { - DDLogError("can not instantiate ImportSettingsController") + LOG.error("Can not instantiate ImportSettingsController") return } diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/MainPageModel.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/MainPageModel.swift index 446d727cd..d5abb795a 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/MainPageModel.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/MainTabBar/MainPage/MainPageModel.swift @@ -30,6 +30,8 @@ protocol MainPageModelProtocol: AnyObject { var delegate: MainPageModelDelegate? { get set } } +private let LOG = LoggerFactory.getLoggerWrapper(MainPageModel.self) + /// Super old model, it should be removed /// Actually it was rewritten in Stories PR final class MainPageModel: MainPageModelProtocol { @@ -128,7 +130,7 @@ final class MainPageModel: MainPageModelProtocol { let message: String if let error = updateError { - DDLogError("(MainPageModel) - updateFiltersAsync; Error: \(error)") + LOG.error("Error: \(error)") message = String.localizedString("filter_updates_error") } else if filtersCount > 0 { let format = String.localizedString("filters_updated_format") diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/SafariProtection/SafariGroupFiltersTableController/AllSafariGroupsFiltersModel.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/SafariProtection/SafariGroupFiltersTableController/AllSafariGroupsFiltersModel.swift index 1db4ad670..59b22f966 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/SafariProtection/SafariGroupFiltersTableController/AllSafariGroupsFiltersModel.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/SafariProtection/SafariGroupFiltersTableController/AllSafariGroupsFiltersModel.swift @@ -19,6 +19,8 @@ import SharedAdGuardSDK import SafariAdGuardSDK +private let LOG = LoggerFactory.getLoggerWrapper(AllSafariGroupsFiltersModel.self) + final class AllSafariGroupsFiltersModel: NSObject, SafariGroupFiltersModelProtocol { // MARK: - Public properties @@ -117,7 +119,7 @@ extension AllSafariGroupsFiltersModel { } } onCbReloaded: { error in if let error = error { - DDLogError("(AllSafariGroupsFiltersModel) - addCustomFilter; Reload CB error when adding custom filter with url=\(meta.filterDownloadPage ?? "nil"); Error: \(error)") + LOG.error("Reload CB error when adding custom filter with url=\(meta.filterDownloadPage ?? "nil"); Error: \(error)") } } } @@ -142,13 +144,13 @@ extension AllSafariGroupsFiltersModel { guard let newModel = newModel as? StateHeaderViewModel else { return } let groupType = newModel.id - DDLogInfo("(AllSafariGroupsFiltersModel) - setGroup; Trying to change group=\(groupType) to state=\(newModel.isEnabled)") + LOG.info("Trying to change group=\(groupType) to state=\(newModel.isEnabled)") do { try safariProtection.setGroup(groupType: groupType, enabled: newModel.isEnabled, onCbReloaded: nil) } catch { - DDLogError("(AllSafariGroupsFiltersModel) - setGroup; DB error when changing group=\(groupType) to state=\(newModel.isEnabled); Error: \(error)") + LOG.error("DB error when changing group=\(groupType) to state=\(newModel.isEnabled); Error: \(error)") } modelsProvider = SafariGroupFiltersModelsProvider(sdkModels: safariProtection.groups, proStatus: configuration.proStatus) @@ -171,7 +173,7 @@ extension AllSafariGroupsFiltersModel { _ = try setFilter(with: groupType.id, filterId: filterId, enabled: newState) } catch { - DDLogError("(OneSafariGroupFiltersModel) - safariFilterStateChanged; Error changing safari filter state; Error: \(error)") + LOG.error("Error changing safari filter state; Error: \(error)") } } diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/SafariProtection/SafariGroupFiltersTableController/OneSafariGroupFiltersModel.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/SafariProtection/SafariGroupFiltersTableController/OneSafariGroupFiltersModel.swift index 59102e404..acca29910 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/SafariProtection/SafariGroupFiltersTableController/OneSafariGroupFiltersModel.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/SafariProtection/SafariGroupFiltersTableController/OneSafariGroupFiltersModel.swift @@ -33,6 +33,8 @@ protocol SafariGroupFiltersModelProtocol: UITableViewDelegate, UITableViewDataSo func setup(tableView: UITableView) } +private let LOG = LoggerFactory.getLoggerWrapper(OneSafariGroupFiltersModel.self) + // TODO: - We should change the order of the filters // For more info about filters order implementation look up `UserRulesModelsProvider` @@ -148,7 +150,7 @@ extension OneSafariGroupFiltersModel { reinit() guard let newFilterMeta = group.filters.first(where: { $0.filterId == filterId }) else { - assertionFailure("group should contain filter with filterId=\(filterId)") + assertionFailure("Group should contain filter with filterId=\(filterId)") throw CommonError.missingData } return newFilterMeta @@ -162,7 +164,7 @@ extension OneSafariGroupFiltersModel { } } onCbReloaded: { error in if let error = error { - DDLogError("(OneSafariGroupFiltersModel) - addCustomFilter; Reload CB error when adding custom filter with url=\(meta.filterDownloadPage ?? "nil"); Error: \(error)") + LOG.error("Reload CB error when adding custom filter with url=\(meta.filterDownloadPage ?? "nil"); Error: \(error)") } } } @@ -171,7 +173,7 @@ extension OneSafariGroupFiltersModel { try safariProtection.renameCustomFilter(withId: filterId, to: newName) reinit() guard let newFilterMeta = group.filters.first(where: { $0.filterId == filterId }) else { - assertionFailure("group should contain filter with filterId=\(filterId)") + assertionFailure("Group should contain filter with filterId=\(filterId)") throw CommonError.missingData } return newFilterMeta @@ -185,7 +187,7 @@ extension OneSafariGroupFiltersModel { do { _ = try setFilter(with: groupType.id, filterId: filterId, enabled: newState) } catch { - DDLogError("(OneSafariGroupFiltersModel) - safariFilterStateChanged; Error changing safari filter state; Error: \(error)") + LOG.error("Error changing safari filter state; Error: \(error)") } } @@ -201,12 +203,12 @@ extension OneSafariGroupFiltersModel { guard let newModel = newModel as? StateHeaderViewModel else { return } let groupType = newModel.id - DDLogInfo("(OneSafariGroupFiltersModel) - setGroup; Trying to change group=\(groupType) to state=\(newModel.isEnabled)") + LOG.info("Trying to change group=\(groupType) to state=\(newModel.isEnabled)") do { try safariProtection.setGroup(groupType: groupType, enabled: newModel.isEnabled, onCbReloaded: nil) } catch { - DDLogError("(OneSafariGroupFiltersModel) - setGroup; DB error when changing group=\(groupType) to state=\(newModel.isEnabled); Error: \(error)") + LOG.error("DB error when changing group=\(groupType) to state=\(newModel.isEnabled); Error: \(error)") } groupModel = StateHeaderViewModel( @@ -229,7 +231,7 @@ extension OneSafariGroupFiltersModel { let index = addButtonIsDisplayed ? indexPath.row - 1 : indexPath.row let filterId = filtersModels[index].filterId guard let filter = group.filters.first(where: { $0.filterId == filterId }) else { - assertionFailure("group should contain filter with filterId=\(filterId)") + assertionFailure("Group should contain filter with filterId=\(filterId)") return } delegate?.filterTapped(filter) diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/SafariProtection/SafariGroupsTableController/SafariGroupsModel.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/SafariProtection/SafariGroupsTableController/SafariGroupsModel.swift index 4aeed7c4e..7d8c11b94 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/SafariProtection/SafariGroupsTableController/SafariGroupsModel.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/SafariProtection/SafariGroupsTableController/SafariGroupsModel.swift @@ -20,12 +20,15 @@ import UIKit.UIImage import SafariAdGuardSDK import SafariServices import UIKit +import SharedAdGuardSDK protocol SafariGroupsModelDelegate: AnyObject { func modelChanged(_ rowToChange: Int) func modelsChanged() } +private let LOG = LoggerFactory.getLoggerWrapper(SafariGroupsModel.self) + final class SafariGroupsModel { private(set) var groups: [SafariProtectionGroupCellModel] = [] @@ -55,7 +58,7 @@ final class SafariGroupsModel { // MARK: - Public methods func setGroup(_ groupType: SafariGroup.GroupType, enabled: Bool) { - DDLogInfo("(SafariGroupsModel) - setGroup; Trying to change group=\(groupType) to state=\(enabled)") + LOG.info("Trying to change group=\(groupType) to state=\(enabled)") do { try safariProtection.setGroup(groupType: groupType, enabled: enabled, onCbReloaded: nil) @@ -64,7 +67,7 @@ final class SafariGroupsModel { delegate?.modelChanged(row) } catch { - DDLogError("(SafariGroupsModel) - setGroup; DB error when changing group=\(groupType) to state=\(enabled); Error: \(error)") + LOG.error("DB error when changing group=\(groupType) to state=\(enabled); Error: \(error)") } } diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/UserRules/DnsUserRulesTableModel.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/UserRules/DnsUserRulesTableModel.swift index 664117369..e81176044 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/UserRules/DnsUserRulesTableModel.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/UserRules/DnsUserRulesTableModel.swift @@ -19,6 +19,8 @@ import SharedAdGuardSDK import DnsAdGuardSDK +private let LOG = LoggerFactory.getLoggerWrapper(DnsUserRulesTableModel.self) + final class DnsUserRulesTableModel: UserRulesTableModelProtocol { // MARK: - Internal properties @@ -121,7 +123,7 @@ final class DnsUserRulesTableModel: UserRulesTableModelProtocol { modelProvider.modifyRule(rule, newRule: newRule) } catch { - DDLogError("(DnsUserRulesTableModel) - ruleStateChanged; Error: \(error)") + LOG.error("Error: \(error)") } } @@ -183,7 +185,7 @@ final class DnsUserRulesTableModel: UserRulesTableModelProtocol { self?.delegate?.importWillStart() self?.addNewRulesAfterImport(text, completion) self?.dnsConfigAssistant.applyDnsPreferences(for: .modifiedDnsRules, completion: nil) - case .failure(let error): + case .error(let error): completion(error) } } diff --git a/AdguardExtension/AdguardApp/UI/ViewControllers/UserRules/SafariUserRulesTableModel.swift b/AdguardExtension/AdguardApp/UI/ViewControllers/UserRules/SafariUserRulesTableModel.swift index e97b08ed1..aa2077882 100644 --- a/AdguardExtension/AdguardApp/UI/ViewControllers/UserRules/SafariUserRulesTableModel.swift +++ b/AdguardExtension/AdguardApp/UI/ViewControllers/UserRules/SafariUserRulesTableModel.swift @@ -19,6 +19,8 @@ import SharedAdGuardSDK import SafariAdGuardSDK +private let LOG = LoggerFactory.getLoggerWrapper(SafariUserRulesTableModel.self) + final class SafariUserRulesTableModel: UserRulesTableModelProtocol { // MARK: - Internal properties @@ -110,7 +112,7 @@ final class SafariUserRulesTableModel: UserRulesTableModelProtocol { modelProvider.modifyRule(rule, newRule: newRule) } catch { - DDLogError("(SafariUserRulesTableModel) - ruleStateChanged; Error: \(error)") + LOG.error("Error: \(error)") } } @@ -166,7 +168,7 @@ final class SafariUserRulesTableModel: UserRulesTableModelProtocol { case .success(let text): self?.delegate?.importWillStart() self?.addNewRulesAfterImport(text, completion) - case .failure(let error): + case .error(let error): completion(error) } } diff --git a/AdguardExtension/AdguardApp/UI/Views/ChartView/ChartViewModel.swift b/AdguardExtension/AdguardApp/UI/Views/ChartView/ChartViewModel.swift index 646bfb857..e9f674a2d 100644 --- a/AdguardExtension/AdguardApp/UI/Views/ChartView/ChartViewModel.swift +++ b/AdguardExtension/AdguardApp/UI/Views/ChartView/ChartViewModel.swift @@ -18,6 +18,7 @@ import DnsAdGuardSDK import UIKit +import SharedAdGuardSDK protocol ChartViewModelDelegate: AnyObject { func numberOfRequestsChanged(with points: (requests: [CGPoint], encrypted: [CGPoint]), @@ -35,6 +36,8 @@ protocol ChartViewModelProtocol { func chartViewSizeChanged(frame: CGRect) } +private let LOG = LoggerFactory.getLoggerWrapper(ChartViewModel.self) + final class ChartViewModel: ChartViewModelProtocol { private struct ChartPoints { let requestsPoints: [CGPoint] @@ -52,7 +55,7 @@ final class ChartViewModel: ChartViewModelProtocol { let record = try activityStatistics.getCounters(for: statisticsPeriod) return record } catch { - DDLogError("(ChartViewModel) statisticsInfo; getCounters return error: \(error)") + LOG.error("getCounters return error: \(error)") return CountersStatisticsRecord.emptyRecord() } } @@ -166,7 +169,7 @@ final class ChartViewModel: ChartViewModelProtocol { guard requestsPoints.count == encryptedPoints.count, !requestsPoints.isEmpty else { - DDLogWarn("(ChartViewModel) findMaxElements; Number of requests points not equal to number of encrypted points or points number is zero") + LOG.warn("Number of requests points not equal to number of encrypted points or points number is zero") return ChartPoints(requestsPoints: [], encryptedPoints: [], maxXelement: 0, maxYelement: 0) } @@ -228,7 +231,7 @@ final class ChartViewModel: ChartViewModelProtocol { // Return modified points private func modifyPoints(points: ChartPoints) -> ChartPoints { guard points.requestsPoints.count == points.encryptedPoints.count, !points.requestsPoints.isEmpty else { - DDLogWarn("(ChartViewModel) modifyCGPoints; Number of requests points not equal to number of encrypted points or points number is zero") + LOG.warn("Number of requests points not equal to number of encrypted points or points number is zero") return ChartPoints(requestsPoints: [], encryptedPoints: [], maxXelement: 0, maxYelement: 0) } diff --git a/AdguardExtension/AdguardApp/ViewModel/UserFilterViewModel.swift b/AdguardExtension/AdguardApp/ViewModel/UserFilterViewModel.swift deleted file mode 100644 index 3cc20839d..000000000 --- a/AdguardExtension/AdguardApp/ViewModel/UserFilterViewModel.swift +++ /dev/null @@ -1,675 +0,0 @@ -// -// This file is part of Adguard for iOS (https://github.com/AdguardTeam/AdguardForiOS). -// Copyright © Adguard Software Limited. All rights reserved. -// -// Adguard for iOS is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Adguard for iOS is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Adguard for iOS. If not, see . -// - -import Foundation - -// MARK: - data types - - -enum UserFilterType { - case blacklist - case whitelist - case invertedWhitelist -} - -enum RuleType { - case blacklist - case whitelist - case comment - case css - case cssException -} - -class RuleInfo: NSObject { - var rule: String - var attributedString: NSAttributedString? - var selected: Bool - var textColor: UIColor! - var font: UIFont! - - // we define the type of rule by special makers that we look for in the text of rule - // https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#basic-rules-syntax - private let whitelistPrefix = "@@" - - // https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#comments - private let commentPrefix = "!" - - // https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#cosmetic-elemhide-rules - private let elemhideMarkers = ["##", "#@#", "#?#", "#@?#"] - - // https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#cosmetic-css-rules - private let cssMarkers = ["#$#", "#@$#", "#$?#", "#@$?#"] - - private let whitelistColor = UIColor(hexString: "35605F") - private let elemhodeColor = UIColor(hexString: "5586C0") - private let cssColor = UIColor(hexString: "3A669C") - private let commentColor = UIColor(hexString: "6D6D6D") - - init(_ rule: String, _ selected: Bool, _ themeService: ThemeServiceProtocol) { - self.rule = rule - self.selected = selected - - super.init() - - let ruleType = self.type(rule) - - let font = ruleType == .comment ? UIFont.italicSystemFont(ofSize: 15.0) : (UIFont(name: "PT Mono", size: 15.0) ?? UIFont.systemFont(ofSize: 15.0)) - - var color: UIColor? - switch ruleType { - case .whitelist: - color = whitelistColor - case .css: - color = elemhodeColor - case .cssException: - color = cssColor - case .comment: - color = commentColor - default: - color = themeService.ruleTextColor - } - self.textColor = color! - self.font = font - } - - private func type(_ rule: String)->RuleType { - - if rule.starts(with: commentPrefix) { - return .comment - } - - if rule.starts(with: whitelistPrefix) { - return .whitelist - } - if elemhideMarkers.contains(where: { (marker) in return rule.contains(marker) }) { - return .css - } - - if cssMarkers.contains(where: { (marker) in return rule.contains(marker) }) { - return .cssException - } - - return .blacklist - } -} - -// MARK: - UserFilterViewModel - -/** - UserFilterViewModel - view model for UserFilterController - */ -class UserFilterViewModel: NSObject { - - // MARK: - public fields - - var type: UserFilterType - - /** - array of all rules or filtered by @searchString array if search is active - */ - @objc dynamic var rules: [RuleInfo] { - get { - return (searchString == nil || searchString!.count == 0) ? - allRules : searchRules - } - } - - // MARK: - private members - private var allRules = [RuleInfo]() - private var searchRules = [RuleInfo]() - - @objc dynamic var searchString: String? { - didSet { - willChangeValue(for: \.rules) - searchRules = allRules.filter({ (ruleInfo) -> Bool in - ruleInfo.attributedString = ruleInfo.rule.lowercased().highlight(search: [searchString?.lowercased()]) - return ruleInfo.rule.lowercased().contains(searchString?.lowercased()) - }) - didChangeValue(for: \.rules) - } - } - - private let resources: AESharedResourcesProtocol - private let contentBlockerService: ContentBlockerService - private let antibanner: AESAntibannerProtocol - private let themeService: ThemeServiceProtocol - - private var ruleObjects = [ASDFilterRule]() - private var invertedWhitelistObject: AEInvertedWhitelistDomainsObject? - - // MARK: - init - - init(_ type: UserFilterType, resources: AESharedResourcesProtocol, contentBlockerService: ContentBlockerService, antibanner: AESAntibannerProtocol, theme: ThemeServiceProtocol) { - - self.type = type - self.resources = resources - self.contentBlockerService = contentBlockerService - self.antibanner = antibanner - self.themeService = theme - - super.init() - - switch type { - case .blacklist: - ruleObjects = antibanner.rules(forFilter: ASDF_USER_FILTER_ID as NSNumber) - allRules = ruleObjects.map({ RuleInfo($0.ruleText, false, themeService) }) - - case .whitelist: - ruleObjects = resources.whitelistContentBlockingRules as? [ASDFilterRule] ?? [ASDFilterRule]() - allRules = ruleObjects.map({ - let domainObject = AEWhitelistDomainObject(rule: $0) - return RuleInfo(domainObject?.domain ?? "", false, themeService) - }) - - case .invertedWhitelist: - invertedWhitelistObject = resources.invertedWhitelistContentBlockingObject - allRules = invertedWhitelistObject?.domains.map({ (rule) -> RuleInfo in - RuleInfo(rule, false, themeService) - }) ?? [RuleInfo]() - } - } - - // MARK: - public methods - /** - adds rule with @ruleText to user filter and reloads safari content blockers - */ - func addRule(ruleText: String, errorHandler: @escaping (_ error: String)->Void, completionHandler: @escaping ()->Void) { - if ruleText.count == 0 { return } - - let components = ruleText.components(separatedBy: .newlines) - - var rules: [String] = [] - - for component in components { - let trimmed = component.trimmingCharacters(in: .whitespaces) - if trimmed.count > 0 { - rules.append(trimmed) - } - } - - if rules.count == 0 { - return - } - - switch type { - case .blacklist: - addBlacklistRules(ruleTexts: rules, completionHandler: completionHandler, errorHandler: errorHandler) - case .whitelist: - addWhitelistDomain(domain: ruleText, completionHandler: completionHandler, errorHandler: errorHandler) - case .invertedWhitelist: - addInvertedWhitelstRule(ruleText: rules.first ?? "", completionHandler: completionHandler, errorHandler: errorHandler) - } - } - - /** - change @rule in user filter and reloads safari content blockers - */ - func changeRule(rule: RuleInfo, newText: String, errorHandler: @escaping (_ error: String)->Void, completionHandler: @escaping ()->Void) { - guard let index = allRules.firstIndex(of: rule) else { - DDLogError("(UserFilterViewModel) change rule failed - rule not found") - return - } - - switch type { - case .blacklist: - changeBlacklistRule(index: index, text: newText, completionHandler: completionHandler, errorHandler: errorHandler) - case .whitelist: - changeWhitelistRule(index: index, text: newText, completionHandler: completionHandler, errorHandler: errorHandler) - case .invertedWhitelist: - changeInvertedWhitelistRule(index: index, text: newText, completionHandler: completionHandler, errorHandler: errorHandler) - } - } - - /** - adds array of rules to user filter and reloads safari content blockers - */ - func addRules(ruleTexts: [String], errorHandler: @escaping (_ error: String)->Void, completionHandler: @escaping ()->Void) { - if type == .blacklist { - addBlacklistRules(ruleTexts: ruleTexts, completionHandler: completionHandler, errorHandler: errorHandler) - } - } - - /** - removes rule from user filter and reloads safari content blockers - */ - func deleteRule(index: Int, errorHandler: @escaping (_ error: String)->Void, completionHandler: @escaping ()->Void) { - switch type { - case .blacklist: - deleteBlacklistRule(index: index, completionHandler: completionHandler, errorHandler: errorHandler) - case .whitelist: - deleteWhitelistRule(index: index, completionHandler: completionHandler, errorHandler: errorHandler) - case .invertedWhitelist: - deleteInvertedWhitelistRule(index: index, completionHandler: completionHandler, errorHandler: errorHandler) - } - } - - /** - removes rule from user filter and reloads safari content blockers - */ - func deleteRule(_ rule: RuleInfo, errorHandler: @escaping (_ error: String)->Void, completionHandler: @escaping ()->Void) { - - guard let index = rules.firstIndex(of: rule) else { return } - - deleteRule(index: index, errorHandler: errorHandler, completionHandler: completionHandler) - } - - /** - returns localized caption for "add a rule" button - */ - func addRuleTitle()->String { - - if type == .blacklist { - return ACLocalizedString("add_blacklist_rule_title", "") - } - else { - return ACLocalizedString("add_whitelist_domain_title", "") - } - } - - /** - select or deselect all rules in user filter - */ - func selectAllRules(_ select: Bool) { - allRules.forEach({ $0.selected = select }) - } - - /** - deletes selected rules from user filter and reloads safari content blockers - */ - func deleteSelected(completionHandler: @escaping ()->Void, errorHandler: @escaping (_ error: String)->Void) { - var newRuleObjects = [ASDFilterRule]() - var newRuleInfos = [RuleInfo]() - - for (index, ruleInfo) in allRules.enumerated() { - if !ruleInfo.selected { - newRuleObjects.append(ruleObjects[index]) - newRuleInfos.append(allRules[index]) - } - } - - setNewRules(newRuleObjects, ruleInfos: newRuleInfos, completionHandler: completionHandler, errorHandler: errorHandler) - } - - /** - retuns all rules from user filter as a plain text - */ - func plainText() -> String { - return allRules.map({ $0.rule }).joined(separator: "\n") - } - - /** - parse plain text to array of rules. Save it to user filter and reload safari content blockers - */ - func importRules(_ plainText: String, errorHandler: @escaping (_ error: String)->Void) { - - let ruleStrings = plainText.components(separatedBy: .newlines) - - var newRuleObjects = [ASDFilterRule]() - var newRuleInfos = [RuleInfo]() - for ruleString in ruleStrings { - - let trimmedRuleString = ruleString.trimmingCharacters(in: .whitespacesAndNewlines) - if trimmedRuleString.count == 0 { - continue - } - - let ruleObject = type == .blacklist ? - ASDFilterRule(text: trimmedRuleString, enabled: true) : - AEWhitelistDomainObject(domain: trimmedRuleString).rule - - let ruleInfo = RuleInfo(trimmedRuleString, false, themeService) - - newRuleObjects.append(ruleObject) - newRuleInfos.append(ruleInfo) - } - - setNewRules(newRuleObjects, ruleInfos: newRuleInfos, completionHandler: { - - }) { (message) in - errorHandler(message) - } - } - - var userFilterEnabled: Bool { - get { - let key = type == .blacklist ? AEDefaultsUserFilterEnabled : AEDefaultsWhitelistEnabled - return resources.sharedDefaults().object(forKey: key) as? Bool ?? true - } - - set { - if userFilterEnabled != newValue { - let key = type == .blacklist ? AEDefaultsUserFilterEnabled : AEDefaultsWhitelistEnabled - resources.sharedDefaults().set(newValue, forKey: key) - contentBlockerService.reloadJsons(backgroundUpdate: false) {_ in } - } - } - } - - // MARK: - private methods - - func addWhitelistDomain(domain: String, completionHandler: @escaping ()->Void, errorHandler: @escaping (_ error: String)->Void) { - - let backgroundTaskId = UIApplication.shared.beginBackgroundTask { } - - let rulesCopy = allRules - let objectsCopy = ruleObjects - - let newRules = allRules + [RuleInfo(domain, false, themeService)] - let newRuleObjects = ruleObjects + [AEWhitelistDomainObject(domain: domain).rule] - - DispatchQueue.main.async { [weak self] in - guard let strongSelf = self else { return } - strongSelf.willChangeValue(for: \.rules) - - strongSelf.allRules = newRules - strongSelf.ruleObjects = newRuleObjects - - strongSelf.didChangeValue(for: \.rules) - - strongSelf.contentBlockerService.addWhitelistDomain(domain) { [weak self] (error) in - DispatchQueue.main.async { - if error == nil { - completionHandler() - } - else { - - self?.willChangeValue(for: \.rules) - self?.allRules = rulesCopy - self?.ruleObjects = objectsCopy - self?.didChangeValue(for: \.rules) - - errorHandler(error!.localizedDescription) - } - - UIApplication.shared.endBackgroundTask(backgroundTaskId) - } - } - } - } - - func addBlacklistRules(ruleTexts: [String], completionHandler: @escaping ()->Void, errorHandler: @escaping (_ error: String)->Void) { - - DispatchQueue.global().async { [weak self] in - guard let strongSelf = self else { return } - - var rulesToAdd = [ASDFilterRule]() - var ruleTextsToAdd = [String]() - for ruleText in ruleTexts { - - if !strongSelf.contentBlockerService.validateRule(ruleText) { - errorHandler(ACLocalizedString("rule_converting_error", nil)) - return - } - let rule = ASDFilterRule(text: ruleText, enabled: true) - - rulesToAdd.append(rule) - ruleTextsToAdd.append(ruleText) - } - - if rulesToAdd.count == 0 { - - DispatchQueue.main.async { - let errorDescription = ACLocalizedString("filter_rules_converting_error", nil) - errorHandler(errorDescription) - } - return - } - - var newRuleObjects = Array(strongSelf.ruleObjects) - var newRuleInfos = Array(strongSelf.allRules) - - newRuleInfos.append(contentsOf: ruleTextsToAdd.map({ (rule) -> RuleInfo in RuleInfo(rule, false, strongSelf.themeService) })) - newRuleObjects.append(contentsOf: rulesToAdd) - - strongSelf.setNewRules(newRuleObjects, ruleInfos: newRuleInfos, completionHandler: completionHandler, errorHandler: errorHandler) - } - } - - func addInvertedWhitelstRule(ruleText: String, completionHandler: @escaping ()->Void, errorHandler: @escaping (_ error: String)->Void){ - - let domainObject = AEWhitelistDomainObject(domain: ruleText) - - if !contentBlockerService.validateRule(domainObject.rule.ruleText) { - errorHandler(ACLocalizedString("rule_converting_error", nil)) - return - } - - let backgroundTaskId = UIApplication.shared.beginBackgroundTask { } - - var domains = allRules - domains.append(RuleInfo(ruleText, false, themeService)) - - willChangeValue(for: \.rules) - allRules = domains - didChangeValue(for: \.rules) - - contentBlockerService.addInvertedWhitelistDomain(ruleText) { (error) in - DispatchQueue.main.async { - [weak self] in - if error == nil { - completionHandler() - self?.willChangeValue(for: \.rules) - self?.allRules = domains - self?.didChangeValue(for: \.rules) - } - else { - DDLogError("(UserFilterViewModel) addInvertedWhitelstRule - Error occured during content blocker reloading - \(error!.localizedDescription)") - errorHandler(error?.localizedDescription ?? "") - } - - UIApplication.shared.endBackgroundTask(backgroundTaskId) - } - } - } - - func setNewRules(_ newRuleObjects: [ASDFilterRule], ruleInfos: [RuleInfo], completionHandler: @escaping ()->Void, errorHandler: @escaping (_ error: String)->Void) { - - let backgroundTaskId = UIApplication.shared.beginBackgroundTask { } - - DispatchQueue.main.async { [weak self] in - guard let strongSelf = self else { return } - - let rulesCopy = strongSelf.allRules - let objectsCopy = strongSelf.ruleObjects - - strongSelf.willChangeValue(for: \.rules) - - strongSelf.allRules = ruleInfos - strongSelf.ruleObjects = newRuleObjects - - strongSelf.didChangeValue(for: \.rules) - - DispatchQueue.global().async { [weak self] in - guard let strongSelf = self else { return } - - switch (strongSelf.type) { - case .blacklist: - if let error = strongSelf.contentBlockerService.replaceUserFilter(newRuleObjects) { - DDLogError("(UserFilterViewModel) setNewRules - Error occured during content blocker reloading - \(error.localizedDescription)") - DispatchQueue.main.async { - strongSelf.willChangeValue(for: \.rules) - strongSelf.allRules = rulesCopy - strongSelf.ruleObjects = objectsCopy - strongSelf.didChangeValue(for: \.rules) - errorHandler(error.localizedDescription) - } - return - } - case .whitelist: - strongSelf.resources.whitelistContentBlockingRules = (strongSelf.ruleObjects as NSArray).mutableCopy() as? NSMutableArray - case .invertedWhitelist: - let invertedWhitelistObject = AEInvertedWhitelistDomainsObject(domains: strongSelf.allRules.map({ $0.rule })) - strongSelf.resources.invertedWhitelistContentBlockingObject = invertedWhitelistObject - } - - completionHandler() - - strongSelf.contentBlockerService.reloadJsons(backgroundUpdate: false) { (error) in - - DDLogError("(UserFilterViewModel) Error occured during content blocker reloading.") - // do not rollback changes and do not show any alert to user in this case - // https://github.com/AdguardTeam/AdguardForiOS/issues/1174 - UIApplication.shared.endBackgroundTask(backgroundTaskId) - } - } - } - } - - func deleteBlacklistRule(index: Int, completionHandler: @escaping ()->Void, errorHandler: @escaping (_ error: String)->Void) { - - let rule = self.rules[index] - guard let index = allRules.firstIndex(of: rule) else { return } - - let ruleObject = ruleObjects[index] - - let filteredRules = allRules.filter({$0 != rule}) - let filteredRuleObjects = ruleObjects.filter({$0 != ruleObject}) - - setNewRules(filteredRuleObjects, ruleInfos: filteredRules, completionHandler: completionHandler, errorHandler: errorHandler) - } - - func deleteWhitelistRule(index: Int, completionHandler: @escaping ()->Void, errorHandler: @escaping (_ error: String)->Void){ - - let oldRules = allRules - let oldRuleObjects = ruleObjects - - let domain = rules[index].rule - willChangeValue(for: \.rules) - allRules.remove(at: index) - ruleObjects.remove(at: index) - didChangeValue(for: \.rules) - - let backgroundTaskId = UIApplication.shared.beginBackgroundTask(expirationHandler: nil) - - contentBlockerService.removeWhitelistDomain(domain) { (error) in - - DispatchQueue.main.async { - if error == nil { - completionHandler() - } - else { - DDLogError("(UserFilterViewModel) deleteWhitelistRule - Error occured during content blocker reloading - \(error!.localizedDescription)") - self.willChangeValue(for: \.rules) - self.allRules = oldRules - self.ruleObjects = oldRuleObjects - self.didChangeValue(for: \.rules) - errorHandler(error?.localizedDescription ?? "") - } - - UIApplication.shared.endBackgroundTask(backgroundTaskId) - } - } - } - - func deleteInvertedWhitelistRule(index: Int, completionHandler: @escaping ()->Void, errorHandler: @escaping (_ error: String)->Void) { - - let backgroundTaskId = UIApplication.shared.beginBackgroundTask(expirationHandler: nil) - - var newAllRules = allRules - let rule = newAllRules.remove(at: index) - - let oldRules = allRules - - willChangeValue(for: \.rules) - allRules = newAllRules - didChangeValue(for: \.rules) - - contentBlockerService.removeInvertedWhitelistDomain(rule.rule) { (error) in - DispatchQueue.main.async { - [weak self] in - if error == nil { - completionHandler() - } - else { - DDLogError("(UserFilterViewModel) deleteInvertedWhitelistRule - Error occured during content blocker reloading - \(error!.localizedDescription)") - self?.willChangeValue(for: \.rules) - self?.allRules = oldRules - self?.didChangeValue(for: \.rules) - errorHandler(error?.localizedDescription ?? "") - } - - UIApplication.shared.endBackgroundTask(backgroundTaskId) - } - } - } - - func changeBlacklistRule(index: Int, text: String, completionHandler: @escaping ()->Void, errorHandler: @escaping (_ error: String)->Void) { - - if !contentBlockerService.validateRule(text) { - errorHandler(ACLocalizedString("rule_converting_error", nil)) - return - } - - let ruleObject = ruleObjects[index] - let rule = allRules[index] - - rule.rule = text - ruleObject.ruleText = text - - setNewRules(ruleObjects, ruleInfos: allRules, completionHandler: completionHandler, errorHandler: errorHandler) - } - - func changeWhitelistRule(index: Int, text: String, completionHandler: @escaping ()->Void, errorHandler: @escaping (_ error: String)->Void) { - - let backgroundTaskId = UIApplication.shared.beginBackgroundTask(expirationHandler: nil) - - let oldRuleObject = ruleObjects[index] - let oldRule = allRules[index] - - contentBlockerService.replaceWhitelistDomain(rules[index].rule, with: text) { (error) in - if error != nil { - DDLogError("(UserFilterViewModel) changeWhitelistRule - Error occured during content blocker reloading - \(error!.localizedDescription)") - } - oldRule.rule = text - oldRuleObject.ruleText = text - - completionHandler() - UIApplication.shared.endBackgroundTask(backgroundTaskId) - } - } - - func changeInvertedWhitelistRule(index: Int, text: String, completionHandler: @escaping ()->Void, errorHandler: @escaping (_ error: String)->Void) { - - let backgroundTaskId = UIApplication.shared.beginBackgroundTask(expirationHandler: nil) - - let domains = allRules - domains[index].rule = text - - willChangeValue(for: \.rules) - allRules = domains - didChangeValue(for: \.rules) - - let invertedWhitelistObject = AEInvertedWhitelistDomainsObject(domains: domains.map({ $0.rule })) - resources.invertedWhitelistContentBlockingObject = invertedWhitelistObject - - contentBlockerService.reloadJsons(backgroundUpdate: false) { [weak self] (error) in - - DispatchQueue.main.async { - if error == nil { - completionHandler() - } - else { - DDLogError("(UserFilterViewModel) changeInvertedWhitelistRule - Error occured during content blocker reloading - \(error!.localizedDescription)") - // do not rollback changes and do not show any alert to user in this case - // https://github.com/AdguardTeam/AdguardForiOS/issues/1174 - completionHandler() - } - - UIApplication.shared.endBackgroundTask(backgroundTaskId) - } - } - } -} diff --git a/AdguardExtension/AdguardTests/AppleSearchAdsTests/AdServicesHelperTest.swift b/AdguardExtension/AdguardTests/AppleSearchAdsTests/AdServicesHelperTest.swift index e521bb8b1..6946e6dc0 100644 --- a/AdguardExtension/AdguardTests/AppleSearchAdsTests/AdServicesHelperTest.swift +++ b/AdguardExtension/AdguardTests/AppleSearchAdsTests/AdServicesHelperTest.swift @@ -47,7 +47,7 @@ class AdServicesHelperTest: XCTestCase { XCTAssertNil(json["clickDate"]) XCTAssertEqual(json, attributionData) expectation.fulfill() - case .failure(let error): XCTFail("\(error)") + case .error(let error): XCTFail("\(error)") } } @@ -70,7 +70,7 @@ class AdServicesHelperTest: XCTestCase { XCTAssertEqual(json["clickDate"], attributionData["clickDate"]) XCTAssertEqual(json, attributionData) expectation.fulfill() - case .failure(let error): XCTFail("\(error)") + case .error(let error): XCTFail("\(error)") } } @@ -87,7 +87,7 @@ class AdServicesHelperTest: XCTestCase { helper.fetchAttributionRecords { result in switch result { case .success(_): XCTFail() - case .failure(let error): + case .error(let error): XCTAssertEqual(error as NSError, self.testError) expectation.fulfill() } @@ -106,7 +106,7 @@ class AdServicesHelperTest: XCTestCase { helper.fetchAttributionRecords { result in switch result { case .success(_): XCTFail() - case .failure(let error): + case .error(let error): XCTAssertEqual(error as! AppleSearchAdsService.AdsError, AppleSearchAdsService.AdsError.missingAttributionData) expectation.fulfill() @@ -128,7 +128,7 @@ class AdServicesHelperTest: XCTestCase { helper.fetchAttributionRecords { result in switch result { case .success(_): XCTFail() - case .failure(let error): + case .error(let error): XCTAssertEqual(error as NSError, self.testError) expectation.fulfill() } diff --git a/AdguardExtension/AdguardTests/AppleSearchAdsTests/AppleSearchAdsServiceTest.swift b/AdguardExtension/AdguardTests/AppleSearchAdsTests/AppleSearchAdsServiceTest.swift index d8db81dd5..38d22e385 100644 --- a/AdguardExtension/AdguardTests/AppleSearchAdsTests/AppleSearchAdsServiceTest.swift +++ b/AdguardExtension/AdguardTests/AppleSearchAdsTests/AppleSearchAdsServiceTest.swift @@ -90,9 +90,9 @@ class AppleSearchAdsServiceTest: XCTestCase { func testProvideAttributionRecordsWithError() { let expectation = XCTestExpectation() if #available(iOS 14.3, *) { - adServicesHelper.stubbedFetchAttributionRecordsCompletionHandlerResult = .failure(testError) + adServicesHelper.stubbedFetchAttributionRecordsCompletionHandlerResult = .error(testError) } else { - iAdFrameworkHelper.stubbedFetchAttributionRecordsCompletionHandlerResult = .failure(testError) + iAdFrameworkHelper.stubbedFetchAttributionRecordsCompletionHandlerResult = .error(testError) } service.provideAttributionRecords { jsonString in diff --git a/AdguardExtension/AdguardTests/AppleSearchAdsTests/IAdFrameworkHelperTest.swift b/AdguardExtension/AdguardTests/AppleSearchAdsTests/IAdFrameworkHelperTest.swift index fe5bf953d..55458feb7 100644 --- a/AdguardExtension/AdguardTests/AppleSearchAdsTests/IAdFrameworkHelperTest.swift +++ b/AdguardExtension/AdguardTests/AppleSearchAdsTests/IAdFrameworkHelperTest.swift @@ -38,7 +38,7 @@ class IAdFrameworkHelperTest: XCTestCase { case .success(let json): XCTAssertFalse(json.isEmpty) XCTAssertEqual(json, self.adClientWrapper.attributionRecords as! [String: String]) - case .failure(let error): XCTFail("\(error)") + case .error(let error): XCTFail("\(error)") } } @@ -51,7 +51,7 @@ class IAdFrameworkHelperTest: XCTestCase { helper.fetchAttributionRecords { records in switch records { case .success(_): XCTFail() - case .failure(let error): + case .error(let error): XCTAssertEqual(error as! AppleSearchAdsService.AdsError, AppleSearchAdsService.AdsError.missingAttributionData) } @@ -66,11 +66,11 @@ class IAdFrameworkHelperTest: XCTestCase { helper.fetchAttributionRecords { records in switch records { case .success(_): XCTFail() - case .failure(let error): + case .error(let error): XCTAssertEqual(error as NSError, self.testError) } } - + XCTAssertEqual(adClientWrapper.invokedRequestAttributionDetailsCount, 1) } } diff --git a/AdguardExtension/AdguardTests/Mocks/AdServicesHelperMock.swift b/AdguardExtension/AdguardTests/Mocks/AdServicesHelperMock.swift index 18e32ebee..cb100032d 100644 --- a/AdguardExtension/AdguardTests/Mocks/AdServicesHelperMock.swift +++ b/AdguardExtension/AdguardTests/Mocks/AdServicesHelperMock.swift @@ -17,14 +17,15 @@ // import Foundation +import SharedAdGuardSDK class AdServicesHelperMock: AdServicesHelperProtocol { var invokedFetchAttributionRecords = false var invokedFetchAttributionRecordsCount = 0 - var stubbedFetchAttributionRecordsCompletionHandlerResult: Result<[String: String], Error>? + var stubbedFetchAttributionRecordsCompletionHandlerResult: Result<[String: String]>? - func fetchAttributionRecords(completionHandler: @escaping (Result<[String: String], Error>) -> Void) { + func fetchAttributionRecords(completionHandler: @escaping (Result<[String: String]>) -> Void) { invokedFetchAttributionRecords = true invokedFetchAttributionRecordsCount += 1 if let result = stubbedFetchAttributionRecordsCompletionHandlerResult { diff --git a/AdguardExtension/AdguardTests/Mocks/IAdFrameworkHelperMock.swift b/AdguardExtension/AdguardTests/Mocks/IAdFrameworkHelperMock.swift index ef805b33b..92d44391c 100644 --- a/AdguardExtension/AdguardTests/Mocks/IAdFrameworkHelperMock.swift +++ b/AdguardExtension/AdguardTests/Mocks/IAdFrameworkHelperMock.swift @@ -17,14 +17,15 @@ // import Foundation +import SharedAdGuardSDK class IAdFrameworkHelperMock: IAdFrameworkHelperProtocol { var invokedFetchAttributionRecords = false var invokedFetchAttributionRecordsCount = 0 - var stubbedFetchAttributionRecordsCompletionHandlerResult: Result<[String: String], Error>? + var stubbedFetchAttributionRecordsCompletionHandlerResult: Result<[String: String]>? - func fetchAttributionRecords(completionHandler: @escaping (Result<[String: String], Error>) -> Void) { + func fetchAttributionRecords(completionHandler: @escaping (Result<[String: String]>) -> Void) { invokedFetchAttributionRecords = true invokedFetchAttributionRecordsCount += 1 if let result = stubbedFetchAttributionRecordsCompletionHandlerResult { diff --git a/AdguardExtension/Common/Extension/AGLoggerExtensions.swift b/AdguardExtension/Common/Extension/AGLoggerExtensions.swift new file mode 100644 index 000000000..54fa5a401 --- /dev/null +++ b/AdguardExtension/Common/Extension/AGLoggerExtensions.swift @@ -0,0 +1,33 @@ +import Foundation +import AGDnsProxy +import SharedAdGuardSDK + +// This callback is called when check upstreams +extension AGLogger { + static func setup(_ logLevel: AGLogLevel) { + + AGLogger.setLevel(logLevel) + + AGLogger.setCallback { level, msg, length in + guard let msg = msg else { return } + let data = Data(bytes: msg, count: Int(length)) + let label = "DnsLibs" + if let str = String(data: data, encoding: .utf8) { + switch (level) { + case .AGLL_ERR: + LoggerWrapper.error(label, str) + case .AGLL_WARN: + LoggerWrapper.warn(label, str) + case .AGLL_INFO: + LoggerWrapper.info(label, str) + case .AGLL_DEBUG: + LoggerWrapper.debug(label, str) + case .AGLL_TRACE: + LoggerWrapper.debug(label, str) + @unknown default: + LoggerWrapper.info(label, str) + } + } + } + } +} diff --git a/AdguardExtension/Common/Extension/LogLevelExtensions.swift b/AdguardExtension/Common/Extension/LogLevelExtensions.swift new file mode 100644 index 000000000..29140604b --- /dev/null +++ b/AdguardExtension/Common/Extension/LogLevelExtensions.swift @@ -0,0 +1,30 @@ +import os.log +import SwiftyBeaver + +extension LogLevel { + + func getOsLogLevel() -> OSLogType { + // Well, we convert our log level to the "OSLogType" log level to communicate with + // Apple native application "Console.app". + // Cupertino guys as always think different and use usual log levels differently from other entire world. + // So, the error for the "Console.app" is just a message with ⚠️ level. + // The the fault for the "Console.app" is a message with ⛔️ level. + // + // Let's make friends 🐸 and 🐍 and provide the correct OSLogType by our log level value. + switch (self) { + case .info: return .info + case .warn: return .error + case .error: return .fault + case .debug: return .debug + } + } + + func getSwiftyBeaverLogLevel() -> SwiftyBeaver.Level { + switch (self) { + case .info: return .info // Will be printed info, warnings and errors + case .warn: return .warning // Will be printed warnings and errors only + case .error: return .error // Will be printed errors only + case .debug: return .debug // Will be printed info, warnings, errors and debug + } + } +} diff --git a/Libs/ACommons/Lang/ACLLogFileManagerDefault.swift b/AdguardExtension/Common/Extension/LoggerManagerExtensions.swift similarity index 64% rename from Libs/ACommons/Lang/ACLLogFileManagerDefault.swift rename to AdguardExtension/Common/Extension/LoggerManagerExtensions.swift index 6b738c2bf..3194656c0 100644 --- a/Libs/ACommons/Lang/ACLLogFileManagerDefault.swift +++ b/AdguardExtension/Common/Extension/LoggerManagerExtensions.swift @@ -17,13 +17,19 @@ // import Foundation +import AGDnsProxy -class ACLLogFileManagerDefault: DDLogFileManagerDefault { +extension LoggerManager { + func configureDnsLibsLogLevel(_ logLevel: LogLevel) { + AGLogger.setup(convertToDnsLibLogLevel(logLevel)) + } - /** - We must override isLogFile to use logs from extensions in main appplication - */ - override func isLogFile(withName fileName: String!) -> Bool { - return true + private func convertToDnsLibLogLevel(_ level: LogLevel) -> AGLogLevel { + switch (level) { + case .info: return .AGLL_INFO + case .warn: return .AGLL_WARN + case .error: return .AGLL_ERR + case .debug: return .AGLL_TRACE + } } } diff --git a/AdguardExtension/Common/Extension/ObjCLogMacro.h b/AdguardExtension/Common/Extension/ObjCLogMacro.h new file mode 100644 index 000000000..b8bdf333e --- /dev/null +++ b/AdguardExtension/Common/Extension/ObjCLogMacro.h @@ -0,0 +1,36 @@ +#import +#import + +/* + * Objective-C Macro wrappers for our SwiftyBeaver logger + */ + + +#define ObjcLogInfo(logger, fmt, ...) \ +[logger info: [NSString stringWithFormat: fmt, ##__VA_ARGS__] \ +: [NSString stringWithFormat:@"%s", __FILE__] \ +: [NSString stringWithFormat:@"%s", __FUNCTION__] \ +line: [NSString stringWithFormat:@"%d", __LINE__] \ +customLabel:nil]; + +#define ObjcLogWarn(logger, fmt, ...) \ +[logger warn: [NSString stringWithFormat: fmt, ##__VA_ARGS__] \ +: [NSString stringWithFormat:@"%s", __FILE__] \ +: [NSString stringWithFormat:@"%s", __FUNCTION__] \ +line: [NSString stringWithFormat:@"%d", __LINE__] \ +customLabel:nil]; + +#define ObjcLogError(logger, fmt, ...) \ +[logger error: [NSString stringWithFormat: fmt, ##__VA_ARGS__] \ +: [NSString stringWithFormat:@"%s", __FILE__] \ +: [NSString stringWithFormat:@"%s", __FUNCTION__] \ +line: [NSString stringWithFormat:@"%d", __LINE__] \ +customLabel:nil]; + +#define ObjcLogDebug(logger, fmt, ...) \ +[logger debug: [NSString stringWithFormat: fmt, ##__VA_ARGS__] \ +: [NSString stringWithFormat:@"%s", __FILE__] \ +: [NSString stringWithFormat:@"%s", __FUNCTION__] \ +line: [NSString stringWithFormat:@"%d", __LINE__] \ +customLabel:nil]; + diff --git a/AdguardExtension/Common/Logger/Destinations/ConsoleAppDestination.swift b/AdguardExtension/Common/Logger/Destinations/ConsoleAppDestination.swift new file mode 100644 index 000000000..8f20961ef --- /dev/null +++ b/AdguardExtension/Common/Logger/Destinations/ConsoleAppDestination.swift @@ -0,0 +1,51 @@ +import Foundation +import SwiftyBeaver +import os.log + +/// Send log messages to debug console and Console.app +class ConsoleAppDestination : BaseDestination { + + override public var defaultHashValue: Int { return 3 } // We use 3 because we want that 🐣 + + private var nativeLoggerWrapper: NativeLoggerWrapper = ConsoleAppDestination.createNativeLoggerWrapper() + + override public func send( + _ level: SwiftyBeaver.Level, + msg: String, + thread: String, + file: String, + function: String, + line: Int, + context: Any? = nil + ) -> String? { + guard let formattedString = super.send(level, msg: msg, thread: thread, file: file, function: function, line: line, context: context) else { + return nil + } + + if level.rawValue >= self.minLevel.rawValue { + let label = context as? String ?? "unknown label" + nativeLoggerWrapper.send(formattedString, convertToCommonLogLevel(level)) + } + + return formattedString + } + + private func convertToCommonLogLevel(_ logLevel: SwiftyBeaver.Level) -> LogLevel { + switch (logLevel) { + case .info: return .info + case .warning: return .warn + case .error: return .error + case .debug: return .debug + case .verbose: return .debug + } + } + + private static func createNativeLoggerWrapper() -> NativeLoggerWrapper { + let subsystem = Bundle.main.bundleIdentifier ?? "com.AdGuard.DefaultIdentifier" + if #available(iOS 14.0, *) { + return NativeLoggerWrapperSystemLoggerImpl(subsystem: subsystem) + } else { + return NativeLoggerWrapperOsLogImpl(subsystem: subsystem) + } + } +} diff --git a/AdguardExtension/Common/Logger/LogLevel.swift b/AdguardExtension/Common/Logger/LogLevel.swift new file mode 100644 index 000000000..e31b9fb92 --- /dev/null +++ b/AdguardExtension/Common/Logger/LogLevel.swift @@ -0,0 +1,8 @@ +import Foundation + +enum LogLevel { + case info + case warn + case error + case debug +} diff --git a/AdguardExtension/Common/Logger/LoggerManager.swift b/AdguardExtension/Common/Logger/LoggerManager.swift new file mode 100644 index 000000000..f5873c1d4 --- /dev/null +++ b/AdguardExtension/Common/Logger/LoggerManager.swift @@ -0,0 +1,9 @@ +import Foundation +import SwiftyBeaver + +protocol LoggerManager : AnyObject { + + var rootLogDirectory: URL { get } + + func configure(_ logLevel: LogLevel) +} diff --git a/AdguardExtension/Common/Logger/LoggerManagerImpl.swift b/AdguardExtension/Common/Logger/LoggerManagerImpl.swift new file mode 100644 index 000000000..3ac2ed67a --- /dev/null +++ b/AdguardExtension/Common/Logger/LoggerManagerImpl.swift @@ -0,0 +1,62 @@ +import Foundation +import SwiftyBeaver +import AGDnsProxy + +/// Manager that create os and file log destinations. Creates and stores labeled loggers +final class LoggerManagerImpl : LoggerManager { + + var rootLogDirectory: URL + + private var osLogDestination: BaseDestination! + private var fileLogDestination: BaseDestination! + + init(url: URL) { + rootLogDirectory = url + + defer { + osLogDestination = createOSLogDestination() + fileLogDestination = createFileLogDestination() + SwiftyBeaver.addDestination(osLogDestination) + SwiftyBeaver.addDestination(fileLogDestination) + configure(.info) + } + } + + func configure(_ logLevel: LogLevel) { + let swiftyBeaverLogLevel = logLevel.getSwiftyBeaverLogLevel() + osLogDestination.minLevel = swiftyBeaverLogLevel + fileLogDestination.minLevel = swiftyBeaverLogLevel + } + + private func createOSLogDestination() -> BaseDestination { + let osLogDestination = ConsoleAppDestination() + osLogDestination.format = "[$T] $L $X - $M" + osLogDestination.asynchronously = true + return osLogDestination + } + + private func createFileLogDestination() -> BaseDestination { + let logDirNameByProcessName = Bundle.main.bundleIdentifier ?? "UnknownProcess" + let specificLogDirectory = rootLogDirectory.appendingPathComponent(logDirNameByProcessName) + let logFileUrl = specificLogDirectory.appendingPathComponent("Log", isDirectory: false) + + createLogDirectoryIfNeeded(specificLogDirectory) + let fileDestination = FileDestination(logFileURL: logFileUrl) + fileDestination.format = "$Dyyyy-MM-dd HH:mm:ss.SSS$d [$T] $L $X - $M" + fileDestination.asynchronously = true + fileDestination.logFileMaxSize = 1024 * 1024 * 20 // We think 20MB should be enough for the one log file + fileDestination.logFileAmount = 10 // We also think only 20 files we want to have + + return fileDestination + } + + private func createLogDirectoryIfNeeded(_ url: URL) { + if FileManager.default.fileExists(atPath: url.path) { return } + + do { + try FileManager.default.createDirectory(at: url, withIntermediateDirectories: true) + } catch { + print("Log directory creation error: \(error)") // TODO improve it at the future + } + } +} diff --git a/AdguardExtension/Common/Logger/NativeLoggerWrapper/NativeLoggerWrapper.swift b/AdguardExtension/Common/Logger/NativeLoggerWrapper/NativeLoggerWrapper.swift new file mode 100644 index 000000000..9b0a82526 --- /dev/null +++ b/AdguardExtension/Common/Logger/NativeLoggerWrapper/NativeLoggerWrapper.swift @@ -0,0 +1,7 @@ +import os.log + +/// Logger protocol for Apple logging system `Logger` and `os_Log` +protocol NativeLoggerWrapper { + /// Sends message to console app and debug console with specified log level + func send(_ message: String, _ logLevel: LogLevel) +} diff --git a/AdguardExtension/Common/Logger/NativeLoggerWrapper/NativeLoggerWrapperOsLogImpl.swift b/AdguardExtension/Common/Logger/NativeLoggerWrapper/NativeLoggerWrapperOsLogImpl.swift new file mode 100644 index 000000000..af8dbf415 --- /dev/null +++ b/AdguardExtension/Common/Logger/NativeLoggerWrapper/NativeLoggerWrapperOsLogImpl.swift @@ -0,0 +1,24 @@ +import Foundation +import os.log + +// This entity is wrapper for the Apple logger system `os_log` +// Since iOS 14.0 this entity would not be used +@available(iOS, deprecated: 14, message: "We should use the `ComLog_NativeLoggerWrapperSystemLoggerImpl` class instead") +class NativeLoggerWrapperOsLogImpl : NativeLoggerWrapper { + + private static let messageTemplate: StaticString = "%{public}@" + + private let osLog: OSLog + + init(subsystem: String) { + self.osLog = OSLog(subsystem: subsystem, category: "General") + } + + func send(_ message: String, _ logLevel: LogLevel) { + if #available(iOS 12.0, *) { + os_log(logLevel.getOsLogLevel(), NativeLoggerWrapperOsLogImpl.messageTemplate, message) + } else { + os_log(NativeLoggerWrapperOsLogImpl.messageTemplate, log: osLog, type: logLevel.getOsLogLevel(), message) + } + } +} diff --git a/AdguardExtension/Common/Logger/NativeLoggerWrapper/NativeLoggerWrapperSystemLoggerImpl.swift b/AdguardExtension/Common/Logger/NativeLoggerWrapper/NativeLoggerWrapperSystemLoggerImpl.swift new file mode 100644 index 000000000..b4648ceff --- /dev/null +++ b/AdguardExtension/Common/Logger/NativeLoggerWrapper/NativeLoggerWrapperSystemLoggerImpl.swift @@ -0,0 +1,18 @@ +import Foundation +import os.log + +/// This object is wrapper for the Apple logger system `Logger` +/// From iOS 14.0 Apple introduce improved API for OSLog framework; See [Logger](https://developer.apple.com/documentation/os/logger) +@available(iOS 14.0, *) +class NativeLoggerWrapperSystemLoggerImpl : NativeLoggerWrapper { + + private let logger: Logger + + init(subsystem: String) { + self.logger = Logger(subsystem: subsystem, category: "General") + } + + func send(_ message: String, _ logLevel: LogLevel) { + logger.log(level: logLevel.getOsLogLevel(), "\(message)") + } +} diff --git a/AdguardExtension/Extension/ContentBlockerRequestHandler.swift b/AdguardExtension/Extension/ContentBlockerRequestHandler.swift index b66a322e0..7162eb4d6 100644 --- a/AdguardExtension/Extension/ContentBlockerRequestHandler.swift +++ b/AdguardExtension/Extension/ContentBlockerRequestHandler.swift @@ -17,6 +17,9 @@ // import SafariAdGuardSDK +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(ContentBlockerRequestHandler.self) class ContentBlockerRequestHandler: NSObject, NSExtensionRequestHandling { func beginRequest(with context: NSExtensionContext) { @@ -24,17 +27,20 @@ class ContentBlockerRequestHandler: NSObject, NSExtensionRequestHandling { let resources = AESharedResources() // Init Logger - ACLLogger.singleton().initLogger(resources.sharedAppLogsURL()) - ACLLogger.singleton().logLevel = resources.isDebugLogs ? ACLLDebugLevel : ACLLDefaultLevel + let logManager = LoggerManagerImpl(url: resources.sharedLogsURL()) + let logLevel: LogLevel = resources.isDebugLogs ? .debug : .info + logManager.configure(logLevel) + LOG.info("InitLogger \(logLevel)") + // migrate settings if needed let migration = ContentBlockerMigrationService(resources: resources) migration.migrateIfNeeded() - DDLogInfo("ActionRequestHandler start request") + LOG.info("ActionRequestHandler start request") guard let cbBundleId = Bundle.main.bundleIdentifier else { - DDLogError("ActionRequestHandler received nil bundle id") + LOG.error("ActionRequestHandler received nil bundle id") context.completeRequest(returningItems: nil, completionHandler: nil) return } @@ -50,13 +56,13 @@ class ContentBlockerRequestHandler: NSObject, NSExtensionRequestHandling { ) url = jsonProvider.jsonUrl } catch { - DDLogError("ActionRequestHandler error getting JSON URL; Error: \(error)") + LOG.error("ActionRequestHandler error getting JSON URL; Error: \(error)") context.completeRequest(returningItems: nil, completionHandler: nil) return } guard let url = url, let attachment = NSItemProvider(contentsOf: url) else { - DDLogError("ActionRequestHandler Can't init attachment") + LOG.error("ActionRequestHandler Can't init attachment") context.completeRequest(returningItems: nil, completionHandler: nil) return } @@ -64,7 +70,7 @@ class ContentBlockerRequestHandler: NSObject, NSExtensionRequestHandling { let item = NSExtensionItem() item.attachments = [attachment] - DDLogInfo("ActionRequestHandler complete request") + LOG.info("ActionRequestHandler complete request") context.completeRequest(returningItems: [item], completionHandler: nil) } } diff --git a/AdguardExtension/Extension/Extension-Bridging-Header.h b/AdguardExtension/Extension/Extension-Bridging-Header.h index ae1ee8798..2adccb767 100644 --- a/AdguardExtension/Extension/Extension-Bridging-Header.h +++ b/AdguardExtension/Extension/Extension-Bridging-Header.h @@ -20,8 +20,6 @@ #define Extension_Bridging_Header_h #import "AESharedResources.h" -#import "DDLogMacros.h" -#import "ACLLogger.h" #import "NSString+Utils.h" #endif /* Extension_Bridging_Header_h */ diff --git a/AdguardExtension/SafariWebExtension/ChunkFileReader.swift b/AdguardExtension/SafariWebExtension/ChunkFileReader.swift index d48ba4d68..88d3815cb 100644 --- a/AdguardExtension/SafariWebExtension/ChunkFileReader.swift +++ b/AdguardExtension/SafariWebExtension/ChunkFileReader.swift @@ -17,6 +17,9 @@ // import Foundation +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(ChunkFileReader.self) /** `ChunkFileReader` is responsible for reading file by chunks without fully loading it to RAM, @@ -42,6 +45,7 @@ import Foundation - Important: Don't forget to close file with `close` function after finished reading it */ + final class ChunkFileReader { // TODO: - write tests @@ -52,7 +56,7 @@ final class ChunkFileReader { init?(fileUrl: URL, chunkSize: UInt64 = 32768) { guard let fileHandle = FileHandle(forReadingAtPath: fileUrl.path) else { - DDLogError("(ChunkFileReader) - init error") + LOG.error("Init error") return nil } self.chunkSize = chunkSize @@ -65,7 +69,7 @@ final class ChunkFileReader { func nextChunk() -> String? { guard let fileHandle = fileHandle else { - DDLogError("(ChunkFileReader) - nextChunk; Attempt to read from closed file") + LOG.error("Attempt to read from closed file") return nil } @@ -78,14 +82,14 @@ final class ChunkFileReader { return nil } } catch { - DDLogError("(ChunkFileReader) - nextChunk; Error reading file: \(error)") + LOG.error("Error reading file: \(error)") return nil } } func rewind() -> Bool { guard let fileHandle = fileHandle else { - DDLogError("(ChunkFileReader) - rewind; Attempt to rewind with closed file") + LOG.error("Attempt to rewind with closed file") return false } @@ -93,7 +97,7 @@ final class ChunkFileReader { try fileHandle.seek(toOffset: 0) return true } catch { - DDLogError("(ChunkFileReader) - rewind; Error when rewinding: \(error)") + LOG.error("Error when rewinding: \(error)") return false } } @@ -102,7 +106,7 @@ final class ChunkFileReader { do { try fileHandle?.close() } catch { - DDLogError("(ChunkFileReader) - close; Error closing file: \(error)") + LOG.error("Error closing file: \(error)") } fileHandle = nil } diff --git a/AdguardExtension/SafariWebExtension/SafariWebExtension-Bridging-Header.h b/AdguardExtension/SafariWebExtension/SafariWebExtension-Bridging-Header.h index bd37ea69a..2725bd3be 100644 --- a/AdguardExtension/SafariWebExtension/SafariWebExtension-Bridging-Header.h +++ b/AdguardExtension/SafariWebExtension/SafariWebExtension-Bridging-Header.h @@ -20,8 +20,6 @@ #define SafariWebExtension_Bridging_Header_h #import "AESharedResources.h" -#import "DDLogMacros.h" -#import "ACLLogger.h" #import "NSString+Utils.h" #import "ADProductInfo.h" diff --git a/AdguardExtension/SafariWebExtension/SafariWebExtensionHandler.swift b/AdguardExtension/SafariWebExtension/SafariWebExtensionHandler.swift index 0728d3add..3a74f05e3 100644 --- a/AdguardExtension/SafariWebExtension/SafariWebExtensionHandler.swift +++ b/AdguardExtension/SafariWebExtension/SafariWebExtensionHandler.swift @@ -17,6 +17,9 @@ // import SafariServices +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(SafariWebExtensionHandler.self) class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling { @@ -25,7 +28,6 @@ class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling { override init() { super.init() - setupLogger() } func beginRequest(with context: NSExtensionContext) { @@ -34,25 +36,15 @@ class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling { let messageDict = item.userInfo?[SFExtensionMessageKey] as! [String: Any] guard let message = Message(message: messageDict) else { - DDLogInfo("Received unknown message: \(messageDict)") + LOG.info("Received unknown message: \(messageDict)") context.completeRequest(returningItems: nil, completionHandler: nil) return } - DDLogInfo("Received message from JS: \(messageDict)") + LOG.info("Received message from JS: \(messageDict)") let result = processor.process(message: message) let response = NSExtensionItem() response.userInfo = [SFExtensionMessageKey: result] context.completeRequest(returningItems: [response], completionHandler: nil) } - - // MARK: - Private methods - - /// Initializes `ACLLogger` - private func setupLogger() { - ACLLogger.singleton()?.initLogger(resources.sharedAppLogsURL()) - let isDebugLogs = resources.isDebugLogs - DDLogDebug("Safari Web Extension was initialized with log level: \(isDebugLogs ? "DEBUG" : "NORMAL")") - ACLLogger.singleton()?.logLevel = isDebugLogs ? ACLLDebugLevel : ACLLDefaultLevel - } } diff --git a/AdguardExtension/SafariWebExtension/SafariWebExtensionMessageProcessor.swift b/AdguardExtension/SafariWebExtension/SafariWebExtensionMessageProcessor.swift index 0434aa795..aea1351f6 100644 --- a/AdguardExtension/SafariWebExtension/SafariWebExtensionMessageProcessor.swift +++ b/AdguardExtension/SafariWebExtension/SafariWebExtensionMessageProcessor.swift @@ -16,12 +16,16 @@ // along with Adguard for iOS. If not, see . // +import UIKit import SafariAdGuardSDK +import SharedAdGuardSDK protocol SafariWebExtensionMessageProcessorProtocol { func process(message: Message) -> [String: Any?] } +private let LOG = LoggerFactory.getLoggerWrapper(SafariWebExtensionMessageProcessor.self) + final class SafariWebExtensionMessageProcessor: SafariWebExtensionMessageProcessorProtocol { // TODO: - This is a temporary workaround; Should be fixed later @@ -58,7 +62,7 @@ final class SafariWebExtensionMessageProcessor: SafariWebExtensionMessageProcess shouldUpdateAdvancedRules = false return [Message.shouldUpdateAdvancedRules: shouldUpdate] default: - DDLogError("Received bad case") + LOG.error("Received bad case") return [Message.messageTypeKey: MessageType.error.rawValue] } } diff --git a/AdguardExtension/SafariWebExtension/Services.swift b/AdguardExtension/SafariWebExtension/Services.swift index 1c8b82b5c..cdf9b9841 100644 --- a/AdguardExtension/SafariWebExtension/Services.swift +++ b/AdguardExtension/SafariWebExtension/Services.swift @@ -17,6 +17,9 @@ // import Foundation +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(Services.self) final class Services { static let shared = Services() @@ -24,10 +27,17 @@ final class Services { let resources: AESharedResourcesProtocol let urlsStorage: SharedStorageUrlsProtocol let processor: SafariWebExtensionMessageProcessorProtocol - + private let loggerManager: LoggerManager + init() { self.resources = AESharedResources() self.urlsStorage = SharedStorageUrls() self.processor = SafariWebExtensionMessageProcessor(resources: resources) + let resources = AESharedResources() + self.loggerManager = LoggerManagerImpl(url: resources.sharedLogsURL()) + let logLevel: LogLevel = resources.isDebugLogs ? .debug : .info + loggerManager.configure(logLevel) + LOG.info("Init services start with logLevel \(logLevel)") + } } diff --git a/AdguardExtension/SharedComponents/Services/Support/SupportService.swift b/AdguardExtension/SharedComponents/Services/Support/SupportService.swift index 0084e706a..9a28f1615 100644 --- a/AdguardExtension/SharedComponents/Services/Support/SupportService.swift +++ b/AdguardExtension/SharedComponents/Services/Support/SupportService.swift @@ -20,6 +20,7 @@ import Zip import SafariAdGuardSDK import DnsAdGuardSDK import AGDnsProxy +import SharedAdGuardSDK protocol SupportServiceProtocol { /// Preparing logs archive to sharing. Return archive file URL in temporary directory @@ -32,6 +33,8 @@ protocol SupportServiceProtocol { func sendFeedback(_ email: String, description: String, sendLogs: Bool, _ completion: @escaping (_ logsSentSuccessfully: Bool) -> Void) } +private let LOG = LoggerFactory.getLoggerWrapper(SupportService.self) + /// Support service assemble app state info final class SupportService: SupportServiceProtocol { fileprivate typealias DnsServerInfo = (serverName: String, serverId: Int, upstreams: String) @@ -51,11 +54,11 @@ final class SupportService: SupportServiceProtocol { // MARK: - Helper variable private let reportUrl = "https://reports.adguard.com/new_issue.html" + private let fileManager = FileManager.default private var appLogsUrls: [URL] { let logsUrl = resources.sharedLogsURL() - let fm = FileManager.default - let logsUrls = try? fm.contentsOfDirectory(at: logsUrl, includingPropertiesForKeys: [URLResourceKey.isDirectoryKey], options: []) + let logsUrls = try? fileManager.contentsOfDirectory(at: logsUrl, includingPropertiesForKeys: [URLResourceKey.isDirectoryKey], options: []) return logsUrls ?? [] } @@ -81,7 +84,6 @@ final class SupportService: SupportServiceProtocol { func exportLogs() throws -> URL? { let archiveName = "AdGuard_logs.zip" - let fileManager = FileManager.default let tmp = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true) let baseUrl = tmp.appendingPathComponent("logs", isDirectory: true) @@ -107,43 +109,34 @@ final class SupportService: SupportServiceProtocol { let appStateUrl = baseUrl.appendingPathComponent("state.txt") try appStateData?.write(to: appStateUrl) - /// Flush Logs before appending them - ACLLogger.singleton()?.flush() - - /// Append log file for each process to base directory - try appLogsUrls.forEach { appLogUrl in - let logFileData = applicationLogData(fromUrl: appLogUrl) - let fileName = appLogUrl.lastPathComponent - let fileUrl = targetsUrl.appendingPathComponent(fileName) - try logFileData.write(to: fileUrl) - } + /// Move logs to tmp directory + try moveFiles(appLogsUrls, targetsUrl) do { try Zip.zipFiles(paths: [baseUrl], zipFilePath: logsZipUrl, password: nil, compression: .BestSpeed, progress: nil) return logsZipUrl } catch { - DDLogError("(SupportService) - exportLogs; Failed to export logs: \(error)") + LOG.error("Failed to export logs: \(error)") } return nil } func deleteLogsFiles() { - let fm = FileManager.default do { if let logsDirectory = self.logsDirectory { - try fm.removeItem(at: logsDirectory) + try fileManager.removeItem(at: logsDirectory) } if let logsZipDirectory = self.logsZipDirectory { - try fm.removeItem(at: logsZipDirectory) + try fileManager.removeItem(at: logsZipDirectory) } self.logsDirectory = nil self.logsZipDirectory = nil } catch { - DDLogError("(SupportService) - deleteLogsFiles; Error removing logs files: \(error)") + LOG.error("Error removing logs files: \(error)") } } @@ -254,59 +247,41 @@ final class SupportService: SupportServiceProtocol { private func createDebugInfo() -> String { - /// Flush Logs before appending them - ACLLogger.singleton()?.flush() + /// Append log file for each process to base - /// Append log file for each process to base directory - return appLogsUrls.reduce("") { resultString, appLogUrl -> String in - let logFileData = applicationLogData(fromUrl: appLogUrl) - let fileName = appLogUrl.lastPathComponent - if let logString = String(data: logFileData, encoding: .utf8), !logString.isEmpty { - let delimeter = getDelimeter(for: fileName) - return delimeter + logString + "\r\n\r\n" + do { + let data = try collectLogDataForReport(appLogsUrls) + if let stringData = String(data: data, encoding: .utf8), !stringData.isEmpty { + LOG.info("Successfully create report logs data") + return stringData } - return "" + LOG.warn("Report logs data is missing") + } catch { + LOG.error("On creating report logs error occurred: \(error)") } - } - /* - Returns Data for certain log file - We have multiple log files, one for each process - */ - private func applicationLogData(fromUrl url: URL) -> Data { - let manager = ACLLogFileManagerDefault(logsDirectory: url.path) - let logFileInfos = manager?.sortedLogFileInfos ?? [] - - var logData = Data() - for info in logFileInfos.reversed() { - let delimeter = getDelimeter(for: info.fileName) - if let delimeterData = delimeter.data(using: .utf8) { - logData.append(delimeterData) - } + return "" - let fileUrl = URL(fileURLWithPath: info.filePath) - if let fileData = try? Data(contentsOf: fileUrl) { - logData.append(fileData) - } - } - return logData } - /* Returns delimeter for filename */ - private func getDelimeter(for fileName: String) -> String { - var delimeter = "\r\n-------------------------------------------------------------\r\n" - delimeter += "LOG FILE: \(fileName)" - delimeter += "\r\n-------------------------------------------------------------\r\n" - return delimeter + /* Returns delimiter for filename */ + private func getDelimiter(for fileName: String) -> String { + var delimiter = "\r\n-------------------------------------------------------------\r\n" + delimiter += "LOG FILE: \(fileName)" + delimiter += "\r\n-------------------------------------------------------------\r\n" + return delimiter } private func appendCBJsonsIntoTemporaryDirectory(cbUrl: URL) throws { let advancedRulesFileUrl = safariProtection.advancedRulesFileUrl - if FileManager.default.fileExists(atPath: advancedRulesFileUrl.path) { - try FileManager.default.copyItem(at: advancedRulesFileUrl, to: cbUrl.appendingPathComponent(advancedRulesFileUrl.lastPathComponent)) + if fileManager.fileExists(atPath: advancedRulesFileUrl.path) { + try fileManager.copyItem(at: advancedRulesFileUrl, to: cbUrl.appendingPathComponent(advancedRulesFileUrl.lastPathComponent)) } + try safariProtection.allContentBlockerJsonUrls.forEach { fileUrl in - try FileManager.default.copyItem(at: fileUrl, to: cbUrl.appendingPathComponent(fileUrl.lastPathComponent)) + if fileManager.fileExists(atPath: fileUrl.path) { + try fileManager.copyItem(at: fileUrl, to: cbUrl.appendingPathComponent(fileUrl.lastPathComponent)) + } } } @@ -329,4 +304,74 @@ final class SupportService: SupportServiceProtocol { return partialResult + filterString } } + + private func moveFiles(_ logFileURLs: [URL], _ targetDirectory: URL) throws { + try logFileURLs.forEach { + LOG.debug("Start moving item at path \($0)") + var targetDirectory = targetDirectory + let fileName = $0.lastPathComponent + targetDirectory.appendPathComponent(fileName) + + try fileManager.moveItem(at: $0, to: targetDirectory) + LOG.debug("Successfully moved item from path \($0)") + } + } + + private func collectLogDataForReport(_ logFilePathes: [URL]) throws -> Data { + LOG.debug("Start collecting report data") + var data = Data() + for processLogDir in logFilePathes { + let processData = try readLogFiles(processLogDir) + data.append(processData) + } + LOG.debug("Report data successfully collected") + return data + } + + private func readLogFiles(_ processLogsDirPath: URL) throws -> Data { + LOG.debug("Start reading LogFiles from \(processLogsDirPath)") + let singleProcessLogsContent = try getDirectoryContentUrls(processLogsDirPath) + var data: Data = Data() + + for logPath in singleProcessLogsContent { + let partOfLogs = try readLogFile(logPath, processName: processLogsDirPath.lastPathComponent) + data.append(partOfLogs) + } + LOG.debug("Successfully read all log files at path \(processLogsDirPath)") + return data + } + + private func readLogFile(_ filePath: URL, processName: String) throws -> Data { + LOG.debug("Start reading log file at path \(filePath)") + var data: Data = Data() + + let fileName = "\(processName).\(filePath.lastPathComponent)" // . + let singleLogFileData = try Data(contentsOf: filePath) + let delimiter = getDelimiter(for: fileName) + + if let delimeterData = delimiter.data(using: .utf8) { + data.append(delimeterData) + } + + data.append(singleLogFileData) + LOG.debug("Successfully read log file data at path \(filePath)") + return data + } + + private func getDirectoryContentUrls(_ target: URL) throws -> [URL] { + LOG.debug("Start getting content from \(target)") + if try target.resourceValues(forKeys: [.isDirectoryKey]).isDirectory == true { + let logsUrls = try fileManager + .contentsOfDirectory(at: target, includingPropertiesForKeys: [.contentModificationDateKey], options: [.skipsHiddenFiles]) + .sorted(by: { + let date0 = try $0.promisedItemResourceValues(forKeys: [.contentModificationDateKey]).contentModificationDate! + let date1 = try $1.promisedItemResourceValues(forKeys: [.contentModificationDateKey]).contentModificationDate! + return date0.compare(date1) == .orderedAscending + }) + LOG.debug("Successfully received content list of (target)") + return logsUrls + } + LOG.debug("Target \(target) is not directory, returns empty list of content as default") + return [] + } } diff --git a/AdguardExtension/SharedComponents/Services/SupportService.swift b/AdguardExtension/SharedComponents/Services/SupportService.swift deleted file mode 100644 index 0d2aa309c..000000000 --- a/AdguardExtension/SharedComponents/Services/SupportService.swift +++ /dev/null @@ -1,155 +0,0 @@ -// -// This file is part of Adguard for iOS (https://github.com/AdguardTeam/AdguardForiOS). -// Copyright © Adguard Software Limited. All rights reserved. -// -// Adguard for iOS is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Adguard for iOS is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Adguard for iOS. If not, see . -// - -import Foundation - -@objc -protocol SupportServiceProtocol { - func proFeaturesStatus()->String - func composeWebReportUrl(_ site: NSURL?)->NSURL -} - -@objc -class SupportService: NSObject, SupportServiceProtocol { - - private let resources: AESharedResourcesProtocol - private let configuration: ConfigurationServiceProtocol - private let complexProtection: ComplexProtectionServiceProtocol - private let dnsProviders: DnsProvidersServiceProtocol - private let networkSettings: NetworkSettingsServiceProtocol - private let dnsFilters: DnsFiltersServiceProtocol - private let productInfo: ADProductInfoProtocol - private let antibanner: AESAntibannerProtocol - - private let reportUrl = "https://reports.adguard.com/new_issue.html" - - @objc - init(resources: AESharedResourcesProtocol, configuration: ConfigurationServiceProtocol, complexProtection: ComplexProtectionServiceProtocol, dnsProviders: DnsProvidersServiceProtocol, networkSettings: NetworkSettingsServiceProtocol, dnsFilters: DnsFiltersServiceProtocol, productInfo: ADProductInfoProtocol, antibanner: AESAntibannerProtocol) { - self.resources = resources - self.configuration = configuration - self.complexProtection = complexProtection - self.dnsProviders = dnsProviders - self.networkSettings = networkSettings - self.dnsFilters = dnsFilters - self.productInfo = productInfo - self.antibanner = antibanner - super.init() - } - - func proFeaturesStatus() -> String { - - let tunnelMode: String - switch resources.tunnelMode { - case APVpnManagerTunnelModeSplit: - tunnelMode = "SPLIT" - case APVpnManagerTunnelModeFull: - tunnelMode = "FULL" - case APVpnManagerTunnelModeFullWithoutVPNIcon: - tunnelMode = "WITHOUT_VPN_ICON" - default: - tunnelMode = "UNKNOWN" - } - - let server = dnsProviders.activeDnsServer - - let customBootstraps = resources.customBootstrapServers?.joined(separator: ", ") ?? "" - let customFallbacks = resources.customFallbackServers?.joined(separator: ", ") ?? "" - - var resultString = """ - - - PRO: - Pro feature \(configuration.proStatus ? "ENABLED" : "DISABLED"). - - System protection enabled: \( complexProtection.systemProtectionEnabled) - Tunnel mode \(tunnelMode) - DNS server: \(server?.name ?? "System default") - Restart when network changes: \(resources.restartByReachability) - Filter mobile data: \(networkSettings.filterMobileDataEnabled) - Filter wi-fi data: \(networkSettings.filterWifiDataEnabled) - - Dns server id: \(server?.serverId ?? "") - Dns custom bootstrap servers: \(customBootstraps)" - Dns custom fallback servers: \(customFallbacks)" - """ - - for upstream in server?.upstreams ?? [] { - resultString.append("\r\nDns upstream: \(upstream)") - } - - if networkSettings.exceptions.count > 0 { - resultString.append("\r\n\r\nWi-Fi exceptions:") - for exception in networkSettings.exceptions { - resultString.append("\r\nWi-Fi name=\"\(exception.rule)\" Enabled=\(exception.enabled)") - } - } - - if dnsFilters.filters.count > 0 { - resultString.append("\r\nDns filters: \r\n"); - - for filter in dnsFilters.filters { - resultString.append("name: \(filter.name ?? "UNDEFINED") id: \(filter.id) url: \(filter.subscriptionUrl ?? "UNDEFINED") enabled: \(filter.enabled)\r\n") - } - } - - return resultString - } - - func composeWebReportUrl(_ site: NSURL?) -> NSURL { - - var params = [String: String]() - - if site != nil { - params["url"] = site!.absoluteString; - } - - params["product_type"] = "iOS"; - params["product_version"] = productInfo.version(); - params["browser"] = "Safari"; - - let filterIDs:[String] = antibanner.activeFilterIDs().map { $0.stringValue } - let filtersString = filterIDs.joined(separator: ".") - - params["filters"] = filtersString - - let dnsEnabled = complexProtection.systemProtectionEnabled; - - params["dns.enabled"] = dnsEnabled ? "true" : "false"; - - if (dnsEnabled){ - if let dnsServer = dnsProviders.activeDnsServer { - params["dns.servers"] = dnsServer.upstreams.joined(separator: ",") - } - - let filtersEnabled = configuration.advancedMode - - params["dns.filters_enabled"] = filtersEnabled ? "true" : "false" - - if filtersEnabled { - let filters = dnsFilters.filters.filter { $0.enabled } - let filterUrls = filters.compactMap { $0.subscriptionUrl } - params["dns.filters"] = filterUrls.joined(separator: ",") - } - } - - let paramsString = ABECRequest.createString(fromParameters: params) - let url = "\(reportUrl)?\(paramsString)" - - return URL(string: url)! as NSURL - } -} diff --git a/AdguardExtension/SharedComponents/UIBackgroundTask.swift b/AdguardExtension/SharedComponents/UIBackgroundTask.swift index 6283fae1d..5f4b6659b 100644 --- a/AdguardExtension/SharedComponents/UIBackgroundTask.swift +++ b/AdguardExtension/SharedComponents/UIBackgroundTask.swift @@ -17,6 +17,9 @@ // import Foundation +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(UIBackgroundTask.self) public final class UIBackgroundTask { @@ -43,25 +46,25 @@ public final class UIBackgroundTask { */ public static func execute(name: String, checkRemainingTime: Bool, blockToExecute: @escaping () -> Void) -> Bool { let backgroundTaskId = UIApplication.shared.beginBackgroundTask(withName: name) { - DDLogInfo("(UIBackgroundTask) - execute \(name); background task is expiring, remaining time: \(UIApplication.shared.backgroundTimeRemaining)") + LOG.info("Execute \(name); background task is expiring, remaining time: \(UIApplication.shared.backgroundTimeRemaining)") } if backgroundTaskId == UIBackgroundTaskIdentifier.invalid { - DDLogWarn("(UIBackgroundTask) - execute \(name); cannot start background operation") + LOG.warn("Execute \(name); cannot start background operation") return false } - DDLogInfo("(UIBackgroundTask) - execute \(name); start background operation") + LOG.info("Execute \(name); start background operation") if checkRemainingTime && UIApplication.shared.backgroundTimeRemaining < UIBackgroundTask.safeRemainingTimeSeconds { - DDLogInfo("(UIBackgroundTask) - execute \(name); remaining time is not enough to complete the task, exiting immediately") + LOG.info("Execute \(name); remaining time is not enough to complete the task, exiting immediately") UIApplication.shared.endBackgroundTask(backgroundTaskId) return false } blockToExecute() - DDLogInfo("(UIBackgroundTask) - execute \(name); finished background operation") + LOG.info("Execute \(name); finished background operation") UIApplication.shared.endBackgroundTask(backgroundTaskId) return true } @@ -69,4 +72,4 @@ public final class UIBackgroundTask { public static func execute(name: String, blockToExecute: @escaping () -> Void) -> Bool { UIBackgroundTask.execute(name: name, checkRemainingTime: false, blockToExecute: blockToExecute) } -} \ No newline at end of file +} diff --git a/AdguardExtension/Tunnel/Tunnel-Bridging-Header.h b/AdguardExtension/Tunnel/Tunnel-Bridging-Header.h index 6401e2f26..13d7c7a8f 100644 --- a/AdguardExtension/Tunnel/Tunnel-Bridging-Header.h +++ b/AdguardExtension/Tunnel/Tunnel-Bridging-Header.h @@ -20,8 +20,6 @@ #define Tunnel_Bridging_Header_h #import "AESharedResources.h" -#import "DDLogMacros.h" -#import "ACLLogger.h" #import "ADLocales.h" #endif /* Tunnel_Bridging_Header_h */ diff --git a/AdguardExtension/Tunnel/TunnelProvider.swift b/AdguardExtension/Tunnel/TunnelProvider.swift index 7e601e3af..cb6245d83 100644 --- a/AdguardExtension/Tunnel/TunnelProvider.swift +++ b/AdguardExtension/Tunnel/TunnelProvider.swift @@ -23,11 +23,14 @@ import SafariAdGuardSDK import Sentry import AGDnsProxy +private let LOG = LoggerFactory.getLoggerWrapper(TunnelProvider.self) + /** This object gives access to a virtual network interface The main logic of this class is implemented in `DnsAdGuardSDK.PacketTunnelProvider` - Seealso https://developer.apple.com/documentation/networkextension/nepackettunnelprovider */ + class TunnelProvider: PacketTunnelProvider { static let tunnelRemoteAddress = "127.1.1.1" @@ -114,37 +117,25 @@ class TunnelProvider: PacketTunnelProvider { // MARK: - private methods private static func setupLogger(_ resources: AESharedResourcesProtocol) { - // TODO: refactor, everywhere is the same code let debugLogs = resources.isDebugLogs - ACLLogger.singleton().initLogger(resources.sharedAppLogsURL()) - ACLLogger.singleton().logLevel = debugLogs ? ACLLDebugLevel : ACLLDefaultLevel - DDLogInfo("Init tunnel with loglevel: \(debugLogs ? "DEBUG" : "NORMAL")") - - Logger.logInfo = { msg in - DDLogInfo(msg) - } - - Logger.logDebug = { msg in - DDLogDebug(msg) - } - - Logger.logError = { msg in - DDLogError(msg) - } + let logManager = LoggerManagerImpl(url: resources.sharedLogsURL()) + let logLevel: LogLevel = debugLogs ? .debug : .info + logManager.configure(logLevel) + LOG.info("Init tunnel with loglevel: \(debugLogs ? "DEBUG" : "NORMAL")") } private static func migrateIfNeeded(resources: AESharedResourcesProtocol, configuration: DnsConfigurationProtocol, networkUtils: NetworkUtilsProtocol) { - DDLogInfo("(TunnelProvider) - migrateIfNeeded; Starting migration in tunnel") + LOG.info("Starting migration in tunnel") let migrationVersionProvider = MigrationServiceVersionProvider(resources: resources) if migrationVersionProvider.isMigrationFrom4_1To4_3Needed { do { let dnsProvidersManager = try DnsProvidersManager(configuration: configuration, userDefaults: resources.sharedDefaults(), networkUtils: networkUtils) let migration = try DnsMigration4_3(resources: resources, dnsProvidersManager: dnsProvidersManager) migration.migrate() - DDLogInfo("(TunnelProvider) - migrateIfNeeded; Migration in tunnel finished") + LOG.info("Migration in tunnel finished") } catch { - DDLogError("(TunnelProvider) migration failed: \(error)") + LOG.error("Migration failed: \(error)") } } } diff --git a/AdguardExtension/YouTubeAdsActionExtension/YouTubeAdsActionExtension-Bridging-Header.h b/AdguardExtension/YouTubeAdsActionExtension/YouTubeAdsActionExtension-Bridging-Header.h index c69c899c3..b2cfe53c5 100644 --- a/AdguardExtension/YouTubeAdsActionExtension/YouTubeAdsActionExtension-Bridging-Header.h +++ b/AdguardExtension/YouTubeAdsActionExtension/YouTubeAdsActionExtension-Bridging-Header.h @@ -20,8 +20,6 @@ #define YouTubeAdsActionExtension_Bridging_Header_h #import "AESharedResources.h" -#import "DDLogMacros.h" -#import "ACLLogger.h" #import "NSString+Utils.h" #endif /* YouTubeAdsActionExtension_Bridging_Header_h */ diff --git a/AdguardExtension/YouTubeAdsActionExtension/YouTubeAdsRequestHandler.swift b/AdguardExtension/YouTubeAdsActionExtension/YouTubeAdsRequestHandler.swift index 6fdb15809..d79862441 100644 --- a/AdguardExtension/YouTubeAdsActionExtension/YouTubeAdsRequestHandler.swift +++ b/AdguardExtension/YouTubeAdsActionExtension/YouTubeAdsRequestHandler.swift @@ -18,6 +18,9 @@ import UIKit import MobileCoreServices +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(YouTubeAdsRequestHandler.self) /// Handler that can process 2 cases: /// - The YouTube link has been shared from the browser @@ -37,10 +40,11 @@ class YouTubeAdsRequestHandler : UINavigationController { let resources = AESharedResources() // Init Logger - ACLLogger.singleton()?.initLogger(resources.sharedAppLogsURL()) + let logManager = LoggerManagerImpl(url: resources.sharedLogsURL()) let isDebugLogs = resources.isDebugLogs - DDLogInfo("(YouTubeAdsRequestHandler) Start with log level: \(isDebugLogs ? "DEBUG" : "Normal")") - ACLLogger.singleton()?.logLevel = isDebugLogs ? ACLLDebugLevel : ACLLDefaultLevel + let logLevel: LogLevel = isDebugLogs ? .debug : .info + logManager.configure(logLevel) + LOG.info("Start with log level: \(isDebugLogs ? "DEBUG" : "Normal")") } override func beginRequest(with context: NSExtensionContext) { @@ -49,15 +53,15 @@ class YouTubeAdsRequestHandler : UINavigationController { extensionContext?.handleInputItem({ [weak self] jsResult in if let result = jsResult { self?.notifications.postNotificationWithoutBadge(title: nil, body: result.status.title, onNotificationSent: { - DDLogInfo("(YouTubeAdsRequestHandler) js finished with result: \(result)") + LOG.info("Js finished with result: \(result)") self?.extensionContext?.completeRequest(returningItems: [], completionHandler: nil) }) } else { - DDLogInfo("(YouTubeAdsRequestHandler) js finished, result is nil") + LOG.info("Js finished, result is nil") self?.extensionContext?.completeRequest(returningItems: [], completionHandler: nil) } }) { [weak self] youTubeShareLinkResult in - DDLogInfo("(YouTubeAdsRequestHandler) result of youtube app share link handling: \(youTubeShareLinkResult.messageForLog)") + LOG.info("Result of youtube app share link handling: \(youTubeShareLinkResult.messageForLog)") guard let videoId = youTubeShareLinkResult.videoId else { self?.finish(withError: youTubeShareLinkResult.sharingLinkError) return @@ -67,7 +71,7 @@ class YouTubeAdsRequestHandler : UINavigationController { let playerController = YoutubePlayerController(videoId: videoId) self?.viewControllers.append(playerController) } - } ?? DDLogInfo("(YouTubeAdsRequestHandler) Failed to access extensionContext") + } ?? LOG.info("Failed to access extensionContext") } @objc private func openURL(_ url: URL) { @@ -113,19 +117,19 @@ fileprivate extension NSExtensionContext { itemProvider.loadItem(forTypeIdentifier: String(kUTTypePropertyList), options: nil) { results, error in if let error = error { - DDLogError("(YouTubeAdsRequestHandler) Error: \(error)") + LOG.error("Error: \(error)") onJsExecuted(nil) return } guard let jsResultDict = results as? [String: Any] else { - DDLogError("(YouTubeAdsRequestHandler) Error - result dict incorrect. Results: \(results.debugDescription )") + LOG.error("Error - result dict incorrect. Results: \(results.debugDescription )") onJsExecuted(nil) return } guard let youTubeAdsJsResultDict = jsResultDict[NSExtensionJavaScriptPreprocessingResultsKey] as? [String: Any] else { - DDLogError("(YouTubeAdsRequestHandler) Error - can not get NSExtensionJavaScriptPreprocessingResultsKey. Results: \(results.debugDescription )") + LOG.error("Error - can not get NSExtensionJavaScriptPreprocessingResultsKey. Results: \(results.debugDescription )") onJsExecuted(nil) return } diff --git a/AdguardExtension/YouTubeAdsActionExtension/YoutubePlayerController.swift b/AdguardExtension/YouTubeAdsActionExtension/YoutubePlayerController.swift index cb12dd36e..ca022d8e2 100644 --- a/AdguardExtension/YouTubeAdsActionExtension/YoutubePlayerController.swift +++ b/AdguardExtension/YouTubeAdsActionExtension/YoutubePlayerController.swift @@ -18,6 +18,9 @@ import UIKit import WebKit +import SharedAdGuardSDK + +private let LOG = LoggerFactory.getLoggerWrapper(YoutubePlayerController.self) /// UIViewController with WKWebView to watch Youtube videos without ads 🎥 /// See: [Jira task](https://jira.adguard.com/browse/AG-11561) @@ -123,7 +126,7 @@ class YoutubePlayerController : UIViewController { // Shows alert for given error and prints logMessage to the log private func showAlert(withError error: YouTubePlayerError, logMessage: String, fromFunction: String = #function) { - DDLogError("(YoutubePlayerController) -> \(fromFunction); \(logMessage)") + LOG.error("\(logMessage)") presentSimpleAlert(title: error.alertTitle, message: error.alertMessage) { self.dismiss(animated: true) } @@ -175,4 +178,4 @@ class YoutubePlayerController : UIViewController { } } } -} \ No newline at end of file +} diff --git a/AdguardSafariExtension-iOS.xcworkspace/xcshareddata/swiftpm/Package.resolved b/AdguardSafariExtension-iOS.xcworkspace/xcshareddata/swiftpm/Package.resolved index 29b782435..218773e15 100644 --- a/AdguardSafariExtension-iOS.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/AdguardSafariExtension-iOS.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -91,6 +91,15 @@ "version": "1.0.1" } }, + { + "package": "SwiftyBeaver", + "repositoryURL": "https://github.com/SwiftyBeaver/SwiftyBeaver", + "state": { + "branch": null, + "revision": "2c039501d6eeb4d4cd4aec4a8d884ad28862e044", + "version": "1.9.5" + } + }, { "package": "Zip", "repositoryURL": "https://github.com/marmelroy/Zip.git", diff --git a/Libs/ACommons/ACLang.h b/Libs/ACommons/ACLang.h index 827066ee5..23a78f9df 100644 --- a/Libs/ACommons/ACLang.h +++ b/Libs/ACommons/ACLang.h @@ -19,8 +19,6 @@ #import "Lang/NSException+Utils.h" #import "Lang/NSString+Utils.h" #import "Lang/NSURL+Utils.h" -#import "Lang/ACLLogger.h" -#import "Lang/ACLFileLogger.h" #import "Lang/ACLWildcard.h" #import "Lang/NSDate+Utils.h" #import "Lang/ACLExecuteBlockDelayed.h" diff --git a/Libs/ACommons/Files/ACFFileUtils.h b/Libs/ACommons/Files/ACFFileUtils.h index 54f98ef3b..4740c1e37 100644 --- a/Libs/ACommons/Files/ACFFileUtils.h +++ b/Libs/ACommons/Files/ACFFileUtils.h @@ -16,6 +16,8 @@ // along with Adguard for iOS. If not, see . // +// TODO: This Objective-C class never USED, remove it + #import @interface ACFFileUtils : NSObject diff --git a/Libs/ACommons/Files/ACFFileUtils.m b/Libs/ACommons/Files/ACFFileUtils.m index 946f72a69..4db114a3e 100644 --- a/Libs/ACommons/Files/ACFFileUtils.m +++ b/Libs/ACommons/Files/ACFFileUtils.m @@ -16,19 +16,30 @@ // along with Adguard for iOS. If not, see . // +// TODO: This Objective-C class never USED, remove it + #import "ACFFileUtils.h" #import "ACLang.h" #import #import #import #import - +#import "ObjCLogMacro.h" +#import // In bytes #define FILE_HASH_DEFAULT_CHUNK_SIZE_FOR_READING_DATA 4096 @implementation ACFFileUtils +static LoggerWrapper *LOG = nil; + ++ (void) initialize { + if (!LOG) { + LOG = [LoggerFactory objcGetLoggerWrapper: ACFFileUtils.self]; + } +} + /// Returns UTF-8 encoding that is default for file contentю + (NSStringEncoding)defaultFileEncoding { @@ -45,9 +56,9 @@ + (NSDate *)fileLastWriteTimeForUrl:(NSURL *)pathUrl if ([pathUrl isFileURL]){ attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:[pathUrl path] error:&err]; - if (err) - DDLogWarn(@"Error getting time for file %@: %@", pathUrl, [err localizedDescription]); - else + if (err) { + ObjcLogWarn(LOG, @"Error getting time for file %@: %@", pathUrl, [err localizedDescription]); + } else result = [attrs fileModificationDate]; } @@ -63,9 +74,9 @@ + (NSDate *)fileCreatedTimeForUrl:(NSURL *)pathUrl if ([pathUrl isFileURL]){ attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:[pathUrl path] error:&err]; - if (err) - DDLogWarn(@"Error getting time for file %@: %@", pathUrl, [err localizedDescription]); - else + if (err) { + ObjcLogWarn(LOG, @"Error getting time for file %@: %@", pathUrl, [err localizedDescription]); + } else result = [attrs fileCreationDate]; } @@ -87,8 +98,8 @@ + (NSData *)readQuetlyForUrl:(NSURL *)pathUrl NSData *result = [NSData dataWithContentsOfURL:pathUrl options:NSDataReadingUncached error:&err]; if (err) { + ObjcLogWarn(LOG, @"Error reading file %@: %@", pathUrl, [err localizedDescription]); - DDLogWarn(@"Error reading file %@: %@", pathUrl, [err localizedDescription]); return nil; } @@ -105,8 +116,9 @@ + (void)writeQuetly:(NSString *)text toFile:(NSURL *)pathUrl NSError *err; - if (![text writeToURL:pathUrl atomically:YES encoding:[ACFFileUtils defaultFileEncoding] error:&err]) - DDLogWarn(@"Error writing to file %@: %@", pathUrl, [err localizedDescription]); + if (![text writeToURL:pathUrl atomically:YES encoding:[ACFFileUtils defaultFileEncoding] error:&err]) { + ObjcLogWarn(LOG, @"Error writing to file %@: %@", pathUrl, [err localizedDescription]) + } } /// Creates file or changes it's last updated time @@ -119,15 +131,16 @@ + (void)touchForUrl:(NSURL *)pathUrl if ([pathUrl isFileURL] && [pathUrl checkResourceIsReachableAndReturnError:nil]) { NSError *err; - if (![manager setAttributes:@{NSFileModificationDate: [NSDate date]} ofItemAtPath:pathUrl.path error:&err]) - DDLogWarn(@"Error touching file %@: %@", pathUrl, [err localizedDescription]); + if (![manager setAttributes:@{NSFileModificationDate: [NSDate date]} ofItemAtPath:pathUrl.path error:&err]) { + ObjcLogWarn(LOG, @"Error touching file %@: %@", pathUrl, [err localizedDescription]); + } } else{ - if (![manager createFileAtPath:pathUrl.path contents:[NSData data] attributes:nil]) - DDLogWarn(@"Error touching file %@: Can't create empty file.", pathUrl); + if (![manager createFileAtPath:pathUrl.path contents:[NSData data] attributes:nil]) { + ObjcLogWarn(LOG, @"Error touching file %@: Can't create empty file.", pathUrl) + } } - } /// Deletes file or directory on the path. @@ -138,8 +151,9 @@ + (BOOL)deleteQuetlyForUrl:(NSURL *)pathUrl NSError *err; BOOL result = [[NSFileManager defaultManager] removeItemAtURL:pathUrl error:&err]; - if (!result) - DDLogWarn(@"Error deleting %@: %@", pathUrl, [err localizedDescription]); + if (!result) { + ObjcLogWarn(LOG, @"Error deleting %@: %@", pathUrl, [err localizedDescription]) + } return result; } diff --git a/Libs/ACommons/Lang/ACLFileLogger.h b/Libs/ACommons/Lang/ACLFileLogger.h deleted file mode 100644 index 727e126c1..000000000 --- a/Libs/ACommons/Lang/ACLFileLogger.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// This file is part of Adguard for iOS (https://github.com/AdguardTeam/AdguardForiOS). -// Copyright © Adguard Software Limited. All rights reserved. -// -// Adguard for iOS is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Adguard for iOS is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Adguard for iOS. If not, see . -// - -#import "DDFileLogger.h" - -@interface ACLFileLogger : DDFileLogger - -@end diff --git a/Libs/ACommons/Lang/ACLFileLogger.m b/Libs/ACommons/Lang/ACLFileLogger.m deleted file mode 100644 index 406451d1f..000000000 --- a/Libs/ACommons/Lang/ACLFileLogger.m +++ /dev/null @@ -1,37 +0,0 @@ -// -// This file is part of Adguard for iOS (https://github.com/AdguardTeam/AdguardForiOS). -// Copyright © Adguard Software Limited. All rights reserved. -// -// Adguard for iOS is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Adguard for iOS is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Adguard for iOS. If not, see . -// - -#import "ACLFileLogger.h" - -@interface DDFileLogger (internal) - -- (NSFileHandle *)currentLogFileHandle; - -@end - -@implementation ACLFileLogger - -- (void)flush{ - @try { - [super flush]; - } - @catch (NSException *exception) { - } -} - -@end diff --git a/Libs/ACommons/Lang/ACLLogger.h b/Libs/ACommons/Lang/ACLLogger.h deleted file mode 100644 index f8684dc5a..000000000 --- a/Libs/ACommons/Lang/ACLLogger.h +++ /dev/null @@ -1,106 +0,0 @@ -// -// This file is part of Adguard for iOS (https://github.com/AdguardTeam/AdguardForiOS). -// Copyright © Adguard Software Limited. All rights reserved. -// -// Adguard for iOS is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Adguard for iOS is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Adguard for iOS. If not, see . -// - -#import -#import "Logger/Lumberjack/DDLogMacros.h" -#import "Logger/Lumberjack/DDFileLogger.h" -#import "Logger/Lumberjack/DDTTYLogger.h" -#import "Logger/Lumberjack/DDOSLogger.h" - -//Max log file size -#define ACL_MAX_LOG_FILE_SIZE 512000 - -// Set this log level for application. -typedef enum{ - - ACLLDefaultLevel = DDLogLevelInfo, - ACLLDebugLevel = DDLogLevelDebug, - ACLLVerboseLevel = DDLogLevelVerbose - -} ACLLogLevelType; - -//--------------------------------------------------- - -#undef LOG_ASYNC_ENABLED -#define LOG_ASYNC_ENABLED false - -#define DDLogTrace() LOG_OBJC_MAYBE(LOG_ASYNC_VERBOSE, ddLogLevel, DDLogFlagVerbose, 0, @"%@[%p]: %@", THIS_FILE, self, THIS_METHOD) - -#define DDLogVerboseTrace(fmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, ddLogLevel, DDLogFlagVerbose, 0, nil, __PRETTY_FUNCTION__, @"(%@[%p]: %@) " fmt, THIS_FILE, self, THIS_METHOD, ##__VA_ARGS__) - -#define DDLogDebugTrace() LOG_MAYBE(LOG_ASYNC_ENABLED, ddLogLevel, DDLogFlagDebug, 0, nil, __PRETTY_FUNCTION__, @"%@[%p]: %@", THIS_FILE, self, THIS_METHOD) - -#define DDLogErrorTrace() LOG_MAYBE(LOG_ASYNC_ENABLED, ddLogLevel, DDLogFlagError, 0, nil, __PRETTY_FUNCTION__, @"Error trace - %@[%p]: %@", THIS_FILE, self, THIS_METHOD) - -extern int ddLogLevel; - -@class ACLFileLogger; - -/** - Global logger class, which have one singleton object. - */ -@interface ACLLogger : NSObject{ - - BOOL _initialized; -} - -+ (ACLLogger *)singleton; - -///////////////////////////////////////////////////////////////////// -#pragma mark Only iOS code here -///////////////////////////////////////////////////////////////////// -#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR || TARGET_OS_IOS - -/** - Initializing of logger. - This method must be called before writing to log file. - - @param folderURL URL of the directory where logger will be write logs. - If nil then will be used default value, that is name of process. - */ -- (void)initLogger:(NSURL *)folderURL; - -///////////////////////////////////////////////////////////////////// -#pragma mark Only OS X code here -///////////////////////////////////////////////////////////////////// -#elif TARGET_OS_MAC - -/** - Initializing of logger. - This method must be called before writing to log file. - - @param appName Directory name where logger will be write logs. - If nil then will be used default value, that is name of process. - */ -- (void)initLogger:(NSString *)appName; - -///////////////////////////////////////////////////////////////////// -#pragma mark Common code here -///////////////////////////////////////////////////////////////////// -#endif - -/// Access to file logger. It need for extracting info from log files. -@property (readonly) ACLFileLogger *fileLogger; - -/// Log level of the application. -@property ACLLogLevelType logLevel; - -/// Flush all logs. -- (void)flush; - -@end diff --git a/Libs/ACommons/Lang/ACLLogger.m b/Libs/ACommons/Lang/ACLLogger.m deleted file mode 100644 index e48130973..000000000 --- a/Libs/ACommons/Lang/ACLLogger.m +++ /dev/null @@ -1,146 +0,0 @@ -// -// This file is part of Adguard for iOS (https://github.com/AdguardTeam/AdguardForiOS). -// Copyright © Adguard Software Limited. All rights reserved. -// -// Adguard for iOS is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Adguard for iOS is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Adguard for iOS. If not, see . -// - -#import "ACLLogger.h" -#import "ACLFileLogger.h" - -int ddLogLevel = DDLogLevelVerbose; - -@interface ACLoggerFormatter : DDLogFileFormatterDefault { - NSDateFormatter *_dateFormatter; -} - -@end - -@implementation ACLoggerFormatter - -- (instancetype)initWithDateFormatter:(NSDateFormatter *)dateFormatter { - self = [super initWithDateFormatter:dateFormatter]; - _dateFormatter = dateFormatter; - return self; -} - -- (NSString *)formatLogMessage:(DDLogMessage *)logMessage -{ - NSString *dateAndTime = [_dateFormatter stringFromDate:(logMessage->_timestamp)]; - - NSString* thread = logMessage->_queueLabel ? [NSString stringWithFormat:@"[%@(%@)]", logMessage->_threadID, logMessage->_queueLabel] : - [NSString stringWithFormat:@"[%@]", logMessage->_threadID]; - return [NSString stringWithFormat:@"%@ %@ %@", dateAndTime, thread, logMessage->_message]; -} - -@end - -@implementation ACLLogger - -static ACLLogger *singletonLogger; - -- (id)init{ - - if (self != singletonLogger) - return nil; - - self = [super init]; - if (self) - { - _initialized = NO; - ddLogLevel = ACLLDefaultLevel; - } - - return self; - -} - - -+ (ACLLogger *)singleton{ - - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - - singletonLogger = [ACLLogger alloc]; - singletonLogger = [singletonLogger init]; - }); - - return singletonLogger; - -} -#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR || TARGET_OS_IOS - -- (void)initLogger:(NSURL *)folderURL{ - - if (!_initialized) { - - DDLogFileManagerDefault *defaultLogFileManager = [[DDLogFileManagerDefault alloc] initWithLogsDirectory:[folderURL path]]; - - _fileLogger = [[ACLFileLogger alloc] initWithLogFileManager:defaultLogFileManager]; - _fileLogger.rollingFrequency = 60 * 60 * 24; // 24 hour rolling - _fileLogger.logFileManager.maximumNumberOfLogFiles = 7; - _fileLogger.maximumFileSize = ACL_MAX_LOG_FILE_SIZE; - NSDateFormatter * dateFormatter = [NSDateFormatter new]; - [dateFormatter setDateFormat:@"yyyy/MM/dd HH:mm:ss:SSS"]; - _fileLogger.logFormatter = [[ACLoggerFormatter alloc] initWithDateFormatter: dateFormatter]; - - [DDLog addLogger:_fileLogger]; -#ifdef DEBUG - [DDLog addLogger:[DDTTYLogger sharedInstance]]; - [DDLog addLogger:[DDOSLogger sharedInstance]]; - _fileLogger.logFileManager.maximumNumberOfLogFiles = 20; -#endif - - _initialized = YES; - } -} - -#endif - -///////////////////////////////////////////////////////////////////// -#pragma mark Properties and public methods -///////////////////////////////////////////////////////////////////// - -- (void)setLogLevel:(ACLLogLevelType)logLevel{ - - [self willChangeValueForKey:@"logLevel"]; - [self.fileLogger rollLogFileWithCompletionBlock:^{ - ddLogLevel = logLevel; - [self didChangeValueForKey:@"logLevel"]; - }]; -} - -- (ACLLogLevelType)logLevel{ - - switch (ddLogLevel) { - case ACLLDefaultLevel: - return ACLLDefaultLevel; - break; - - case ACLLDebugLevel: - return ACLLDebugLevel; - break; - - default: - return ACLLDefaultLevel; - break; - } -} - -- (void)flush{ - - [DDLog flushLog]; -} - -@end diff --git a/Libs/ACommons/Lang/ACLWildcard.h b/Libs/ACommons/Lang/ACLWildcard.h index 03fe84123..a67ed1c2f 100644 --- a/Libs/ACommons/Lang/ACLWildcard.h +++ b/Libs/ACommons/Lang/ACLWildcard.h @@ -16,6 +16,8 @@ // along with Adguard for iOS. If not, see . // +// TODO: This Objective-C class never USED, remove it + #import @interface ACLWildcard : NSRegularExpression diff --git a/Libs/ACommons/Lang/ACLWildcard.m b/Libs/ACommons/Lang/ACLWildcard.m index 8fcc401d3..bb5bf3407 100644 --- a/Libs/ACommons/Lang/ACLWildcard.m +++ b/Libs/ACommons/Lang/ACLWildcard.m @@ -16,10 +16,13 @@ // along with Adguard for iOS. If not, see . // -#import "ACLLogger.h" +// TODO: This Objective-C class never USED, remove it + #import "NSString+Utils.h" #import "NSException+Utils.h" #import "ACLWildcard.h" +#import "ObjCLogMacro.h" +#import #define MASK_ANY_SYMBOLS @"*" #define MASK_ANY_SYMBOL @"?" @@ -33,10 +36,18 @@ - (NSString *)extractShortcut:(NSString *)fromPattern; @implementation ACLWildcard +static LoggerWrapper *LOG = nil; + ///////////////////////////////////////////////////////////////////// #pragma mark - Init and Class methods ///////////////////////////////////////////////////////////////////// ++ (void) initialize { + if (!LOG) { + LOG = [LoggerFactory objcGetLoggerWrapper: ACLWildcard.self]; + } +} + - (id)initWithWildcard:(NSString *)pattern options:(NSRegularExpressionOptions)options error:(NSError *__autoreleasing *)error { self = [super initWithPattern:[ACLWildcard regexFromWildcard:pattern] options:options error:error]; @@ -54,10 +65,9 @@ + (ACLWildcard *)wildcard:(NSString *)pattern options:(NSRegularExpressionOption NSError *err; ACLWildcard *wildcard = [[ACLWildcard alloc] initWithWildcard:pattern options:options error:&err]; - if (err){ - - DDLogWarn(@"Can't create regex for: %@", pattern); - DDLogWarn(@"Regex creation error: %@", [err localizedDescription]); + if (err) { + ObjcLogWarn(LOG, @"Can't create regex for: %@", pattern); + ObjcLogWarn(LOG, @"Regex creation error: %@", [err localizedDescription]); return nil; } diff --git a/Libs/ACommons/Lang/Logger/Lumberjack/CLI/CLIColor.h b/Libs/ACommons/Lang/Logger/Lumberjack/CLI/CLIColor.h deleted file mode 100755 index ab9fcf429..000000000 --- a/Libs/ACommons/Lang/Logger/Lumberjack/CLI/CLIColor.h +++ /dev/null @@ -1,48 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2018, Deusty, LLC -// All rights reserved. -// -// Redistribution and use of this software in source and binary forms, -// with or without modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Neither the name of Deusty nor the names of its contributors may be used -// to endorse or promote products derived from this software without specific -// prior written permission of Deusty, LLC. - -#if TARGET_OS_OSX - -#import -#import - -/** - * This class represents an NSColor replacement for CLI projects that don't link with AppKit - **/ -@interface CLIColor : NSObject - -/** - * Convenience method for creating a `CLIColor` instance from RGBA params - * - * @param red red channel, between 0 and 1 - * @param green green channel, between 0 and 1 - * @param blue blue channel, between 0 and 1 - * @param alpha alpha channel, between 0 and 1 - */ -+ (CLIColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; - -/** - * Get the RGBA components from a `CLIColor` - * - * @param red red channel, between 0 and 1 - * @param green green channel, between 0 and 1 - * @param blue blue channel, between 0 and 1 - * @param alpha alpha channel, between 0 and 1 - */ -- (void)getRed:(CGFloat *)red green:(CGFloat *)green blue:(CGFloat *)blue alpha:(CGFloat *)alpha NS_SWIFT_NAME(get(red:green:blue:alpha:)); - -@end - -#endif diff --git a/Libs/ACommons/Lang/Logger/Lumberjack/CLI/CLIColor.m b/Libs/ACommons/Lang/Logger/Lumberjack/CLI/CLIColor.m deleted file mode 100755 index 10516761d..000000000 --- a/Libs/ACommons/Lang/Logger/Lumberjack/CLI/CLIColor.m +++ /dev/null @@ -1,59 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2018, Deusty, LLC -// All rights reserved. -// -// Redistribution and use of this software in source and binary forms, -// with or without modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Neither the name of Deusty nor the names of its contributors may be used -// to endorse or promote products derived from this software without specific -// prior written permission of Deusty, LLC. - -#if TARGET_OS_OSX - -#import "CLIColor.h" - -@interface CLIColor () { - CGFloat _red, _green, _blue, _alpha; -} - -@end - - -@implementation CLIColor - -+ (CLIColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha { - CLIColor *color = [CLIColor new]; - - color->_red = red; - color->_green = green; - color->_blue = blue; - color->_alpha = alpha; - return color; -} - -- (void)getRed:(CGFloat *)red green:(CGFloat *)green blue:(CGFloat *)blue alpha:(CGFloat *)alpha { - if (red) { - *red = _red; - } - - if (green) { - *green = _green; - } - - if (blue) { - *blue = _blue; - } - - if (alpha) { - *alpha = _alpha; - } -} - -@end - -#endif diff --git a/Libs/ACommons/Lang/Logger/Lumberjack/CocoaLumberjack.h b/Libs/ACommons/Lang/Logger/Lumberjack/CocoaLumberjack.h deleted file mode 100755 index 539db0b28..000000000 --- a/Libs/ACommons/Lang/Logger/Lumberjack/CocoaLumberjack.h +++ /dev/null @@ -1,102 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2018, Deusty, LLC -// All rights reserved. -// -// Redistribution and use of this software in source and binary forms, -// with or without modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Neither the name of Deusty nor the names of its contributors may be used -// to endorse or promote products derived from this software without specific -// prior written permission of Deusty, LLC. - -/** - * Welcome to CocoaLumberjack! - * - * The project page has a wealth of documentation if you have any questions. - * https://github.com/CocoaLumberjack/CocoaLumberjack - * - * If you're new to the project you may wish to read "Getting Started" at: - * Documentation/GettingStarted.md - * - * Otherwise, here is a quick refresher. - * There are three steps to using the macros: - * - * Step 1: - * Import the header in your implementation or prefix file: - * - * #import - * - * Step 2: - * Define your logging level in your implementation file: - * - * // Log levels: off, error, warn, info, verbose - * static const DDLogLevel ddLogLevel = DDLogLevelVerbose; - * - * Step 2 [3rd party frameworks]: - * - * Define your LOG_LEVEL_DEF to a different variable/function than ddLogLevel: - * - * // #undef LOG_LEVEL_DEF // Undefine first only if needed - * #define LOG_LEVEL_DEF myLibLogLevel - * - * Define your logging level in your implementation file: - * - * // Log levels: off, error, warn, info, verbose - * static const DDLogLevel myLibLogLevel = DDLogLevelVerbose; - * - * Step 3: - * Replace your NSLog statements with DDLog statements according to the severity of the message. - * - * NSLog(@"Fatal error, no dohickey found!"); -> DDLogError(@"Fatal error, no dohickey found!"); - * - * DDLog works exactly the same as NSLog. - * This means you can pass it multiple variables just like NSLog. - **/ - -#import - -//! Project version number for CocoaLumberjack. -FOUNDATION_EXPORT double CocoaLumberjackVersionNumber; - -//! Project version string for CocoaLumberjack. -FOUNDATION_EXPORT const unsigned char CocoaLumberjackVersionString[]; - -// Disable legacy macros -#ifndef DD_LEGACY_MACROS - #define DD_LEGACY_MACROS 0 -#endif - -// Core -#import "DDLog.h" - -// Main macros -#import "DDLogMacros.h" -#import "DDAssertMacros.h" - -// Capture ASL -#import "DDASLLogCapture.h" - -// Loggers -#import "DDLoggerNames.h" - -#import "DDTTYLogger.h" -#import "DDASLLogger.h" -#import "DDFileLogger.h" -#import "DDOSLogger.h" - -// Extensions -#import "DDContextFilterLogFormatter.h" -#import "DDDispatchQueueLogFormatter.h" -#import "DDMultiFormatter.h" - -// CLI -#import "CLIColor.h" - -// etc -#import "DDAbstractDatabaseLogger.h" -#import "DDLog+LOGV.h" -#import "DDLegacyMacros.h" diff --git a/Libs/ACommons/Lang/Logger/Lumberjack/CocoaLumberjack.swift b/Libs/ACommons/Lang/Logger/Lumberjack/CocoaLumberjack.swift deleted file mode 100755 index d679bb4ae..000000000 --- a/Libs/ACommons/Lang/Logger/Lumberjack/CocoaLumberjack.swift +++ /dev/null @@ -1,129 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2018, Deusty, LLC -// All rights reserved. -// -// Redistribution and use of this software in source and binary forms, -// with or without modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Neither the name of Deusty nor the names of its contributors may be used -// to endorse or promote products derived from this software without specific -// prior written permission of Deusty, LLC. - -import Foundation - -extension DDLogFlag { - public static func from(_ logLevel: DDLogLevel) -> DDLogFlag { - return DDLogFlag(rawValue: logLevel.rawValue) - } - - public init(_ logLevel: DDLogLevel) { - self = DDLogFlag(rawValue: logLevel.rawValue) - } - - /// Returns the log level, or the lowest equivalant. - public func toLogLevel() -> DDLogLevel { - if let ourValid = DDLogLevel(rawValue: rawValue) { - return ourValid - } else { - if contains(.verbose) { - return .verbose - } else if contains(.debug) { - return .debug - } else if contains(.info) { - return .info - } else if contains(.warning) { - return .warning - } else if contains(.error) { - return .error - } else { - return .off - } - } - } -} - -/// The log level that can dynamically limit log messages (vs. the static DDDefaultLogLevel). This log level will only be checked, if the message passes the `DDDefaultLogLevel`. -public var dynamicLogLevel = DDLogLevel.all - -/// Resets the `dynamicLogLevel` to `.all`. -/// - SeeAlso: `dynamicLogLevel` -@inlinable -public func resetDynamicLogLevel() { - dynamicLogLevel = .all -} - -@available(*, deprecated, message: "Please use dynamicLogLevel", renamed: "dynamicLogLevel") -public var defaultDebugLevel: DDLogLevel { - get { - return dynamicLogLevel - } - set { - dynamicLogLevel = newValue - } -} - -@available(*, deprecated, message: "Please use resetDynamicLogLevel", renamed: "resetDynamicLogLevel") -public func resetDefaultDebugLevel() { - resetDynamicLogLevel() -} - -@inlinable -public func _DDLogMessage(_ message: @autoclosure () -> String, level: DDLogLevel, flag: DDLogFlag, context: Int, file: StaticString, function: StaticString, line: UInt, tag: Any?, asynchronous: Bool, ddlog: DDLog) { - // The `dynamicLogLevel` will always be checked here (instead of being passed in). We cannot "mix" it with the `DDDefaultLogLevel`, because otherwise the compiler won't strip strings that are not logged. - if level.rawValue & flag.rawValue != 0 && dynamicLogLevel.rawValue & flag.rawValue != 0 { - // Tell the DDLogMessage constructor to copy the C strings that get passed to it. - let logMessage = DDLogMessage(message: message(), level: level, flag: flag, context: context, file: String(describing: file), function: String(describing: function), line: line, tag: tag, options: [.copyFile, .copyFunction], timestamp: nil) - ddlog.log(asynchronous: asynchronous, message: logMessage) - } -} - - -@inlinable -public func DDLogDebug(_ message: @autoclosure () -> String, level: DDLogLevel = DDDefaultLogLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: Any? = nil, asynchronous async: Bool = false, ddlog: DDLog = DDLog.sharedInstance) { - _DDLogMessage(message(), level: level, flag: .debug, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog) -} - -@inlinable -public func DDLogInfo(_ message: @autoclosure () -> String, level: DDLogLevel = DDDefaultLogLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: Any? = nil, asynchronous async: Bool = false, ddlog: DDLog = DDLog.sharedInstance) { - _DDLogMessage(message(), level: level, flag: .info, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog) -} - -@inlinable -public func DDLogWarn(_ message: @autoclosure () -> String, level: DDLogLevel = DDDefaultLogLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: Any? = nil, asynchronous async: Bool = false, ddlog: DDLog = DDLog.sharedInstance) { - _DDLogMessage(message(), level: level, flag: .warning, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog) -} - -@inlinable -public func DDLogVerbose(_ message: @autoclosure () -> String, level: DDLogLevel = DDDefaultLogLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: Any? = nil, asynchronous async: Bool = false, ddlog: DDLog = DDLog.sharedInstance) { - _DDLogMessage(message(), level: level, flag: .verbose, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog) -} - -@inlinable -public func DDLogError(_ message: @autoclosure () -> String, level: DDLogLevel = DDDefaultLogLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: Any? = nil, asynchronous async: Bool = false, ddlog: DDLog = DDLog.sharedInstance) { - _DDLogMessage(message(), level: level, flag: .error, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog) -} - -/// Returns a String of the current filename, without full path or extension. -/// -/// Analogous to the C preprocessor macro `THIS_FILE`. -public func currentFileName(_ fileName: StaticString = #file) -> String { - var str = String(describing: fileName) - if let idx = str.range(of: "/", options: .backwards)?.upperBound { - str = String(str[idx...]) - } - if let idx = str.range(of: ".", options: .backwards)?.lowerBound { - str = String(str[.. String { - return currentFileName(fileName) -} diff --git a/Libs/ACommons/Lang/Logger/Lumberjack/DDASLLogCapture.h b/Libs/ACommons/Lang/Logger/Lumberjack/DDASLLogCapture.h deleted file mode 100755 index 1b58aca98..000000000 --- a/Libs/ACommons/Lang/Logger/Lumberjack/DDASLLogCapture.h +++ /dev/null @@ -1,42 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2018, Deusty, LLC -// All rights reserved. -// -// Redistribution and use of this software in source and binary forms, -// with or without modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Neither the name of Deusty nor the names of its contributors may be used -// to endorse or promote products derived from this software without specific -// prior written permission of Deusty, LLC. - -#import "DDASLLogger.h" - -@protocol DDLogger; - -/** - * This class provides the ability to capture the ASL (Apple System Logs) - */ -API_DEPRECATED("Use DDOSLogger instead", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)) -@interface DDASLLogCapture : NSObject - -/** - * Start capturing logs - */ -+ (void)start; - -/** - * Stop capturing logs - */ -+ (void)stop; - -/** - * The current capture level. - * @note Default log level: DDLogLevelVerbose (i.e. capture all ASL messages). - */ -@property (class) DDLogLevel captureLevel; - -@end diff --git a/Libs/ACommons/Lang/Logger/Lumberjack/DDASLLogCapture.m b/Libs/ACommons/Lang/Logger/Lumberjack/DDASLLogCapture.m deleted file mode 100755 index c2146ae7d..000000000 --- a/Libs/ACommons/Lang/Logger/Lumberjack/DDASLLogCapture.m +++ /dev/null @@ -1,202 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2018, Deusty, LLC -// All rights reserved. -// -// Redistribution and use of this software in source and binary forms, -// with or without modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Neither the name of Deusty nor the names of its contributors may be used -// to endorse or promote products derived from this software without specific -// prior written permission of Deusty, LLC. - -#import "DDASLLogCapture.h" - -// Disable legacy macros -#ifndef DD_LEGACY_MACROS - #define DD_LEGACY_MACROS 0 -#endif - -#if !TARGET_OS_WATCH - -#import "DDLog.h" - -#include -#include -#include -#include - -static BOOL _cancel = YES; -static DDLogLevel _captureLevel = DDLogLevelVerbose; - -@implementation DDASLLogCapture - -+ (void)start { - // Ignore subsequent calls - if (!_cancel) { - return; - } - - _cancel = NO; - - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) { - [self captureAslLogs]; - }); -} - -+ (void)stop { - _cancel = YES; -} - -+ (DDLogLevel)captureLevel { - return _captureLevel; -} - -+ (void)setCaptureLevel:(DDLogLevel)level { - _captureLevel = level; -} - -#pragma mark - Private methods - -+ (void)configureAslQuery:(aslmsg)query { - const char param[] = "7"; // ASL_LEVEL_DEBUG, which is everything. We'll rely on regular DDlog log level to filter - - asl_set_query(query, ASL_KEY_LEVEL, param, ASL_QUERY_OP_LESS_EQUAL | ASL_QUERY_OP_NUMERIC); - - // Don't retrieve logs from our own DDASLLogger - asl_set_query(query, kDDASLKeyDDLog, kDDASLDDLogValue, ASL_QUERY_OP_NOT_EQUAL); - -#if !TARGET_OS_IPHONE || (defined(TARGET_SIMULATOR) && TARGET_SIMULATOR) - int processId = [[NSProcessInfo processInfo] processIdentifier]; - char pid[16]; - sprintf(pid, "%d", processId); - asl_set_query(query, ASL_KEY_PID, pid, ASL_QUERY_OP_EQUAL | ASL_QUERY_OP_NUMERIC); -#endif -} - -+ (void)aslMessageReceived:(aslmsg)msg { - const char* messageCString = asl_get( msg, ASL_KEY_MSG ); - if ( messageCString == NULL ) - return; - - DDLogFlag flag; - BOOL async; - - const char* levelCString = asl_get(msg, ASL_KEY_LEVEL); - switch (levelCString? atoi(levelCString) : 0) { - // By default all NSLog's with a ASL_LEVEL_WARNING level - case ASL_LEVEL_EMERG : - case ASL_LEVEL_ALERT : - case ASL_LEVEL_CRIT : flag = DDLogFlagError; async = NO; break; - case ASL_LEVEL_ERR : flag = DDLogFlagWarning; async = YES; break; - case ASL_LEVEL_WARNING : flag = DDLogFlagInfo; async = YES; break; - case ASL_LEVEL_NOTICE : flag = DDLogFlagDebug; async = YES; break; - case ASL_LEVEL_INFO : - case ASL_LEVEL_DEBUG : - default : flag = DDLogFlagVerbose; async = YES; break; - } - - if (!(_captureLevel & flag)) { - return; - } - - // NSString * sender = [NSString stringWithCString:asl_get(msg, ASL_KEY_SENDER) encoding:NSUTF8StringEncoding]; - NSString *message = @(messageCString); - - const char* secondsCString = asl_get( msg, ASL_KEY_TIME ); - const char* nanoCString = asl_get( msg, ASL_KEY_TIME_NSEC ); - NSTimeInterval seconds = secondsCString ? strtod(secondsCString, NULL) : [NSDate timeIntervalSinceReferenceDate] - NSTimeIntervalSince1970; - double nanoSeconds = nanoCString? strtod(nanoCString, NULL) : 0; - NSTimeInterval totalSeconds = seconds + (nanoSeconds / 1e9); - - NSDate *timeStamp = [NSDate dateWithTimeIntervalSince1970:totalSeconds]; - - DDLogMessage *logMessage = [[DDLogMessage alloc]initWithMessage:message - level:_captureLevel - flag:flag - context:0 - file:@"DDASLLogCapture" - function:0 - line:0 - tag:nil - options:0 - timestamp:timeStamp]; - - [DDLog log:async message:logMessage]; -} - -+ (void)captureAslLogs { - @autoreleasepool - { - /* - We use ASL_KEY_MSG_ID to see each message once, but there's no - obvious way to get the "next" ID. To bootstrap the process, we'll - search by timestamp until we've seen a message. - */ - - struct timeval timeval = { - .tv_sec = 0 - }; - gettimeofday(&timeval, NULL); - unsigned long long startTime = (unsigned long long)timeval.tv_sec; - __block unsigned long long lastSeenID = 0; - - /* - syslogd posts kNotifyASLDBUpdate (com.apple.system.logger.message) - through the notify API when it saves messages to the ASL database. - There is some coalescing - currently it is sent at most twice per - second - but there is no documented guarantee about this. In any - case, there may be multiple messages per notification. - - Notify notifications don't carry any payload, so we need to search - for the messages. - */ - int notifyToken = 0; // Can be used to unregister with notify_cancel(). - notify_register_dispatch(kNotifyASLDBUpdate, ¬ifyToken, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^(int token) - { - // At least one message has been posted; build a search query. - @autoreleasepool - { - aslmsg query = asl_new(ASL_TYPE_QUERY); - char stringValue[64]; - - if (lastSeenID > 0) { - snprintf(stringValue, sizeof stringValue, "%llu", lastSeenID); - asl_set_query(query, ASL_KEY_MSG_ID, stringValue, ASL_QUERY_OP_GREATER | ASL_QUERY_OP_NUMERIC); - } else { - snprintf(stringValue, sizeof stringValue, "%llu", startTime); - asl_set_query(query, ASL_KEY_TIME, stringValue, ASL_QUERY_OP_GREATER_EQUAL | ASL_QUERY_OP_NUMERIC); - } - - [self configureAslQuery:query]; - - // Iterate over new messages. - aslmsg msg; - aslresponse response = asl_search(NULL, query); - - while ((msg = asl_next(response))) - { - [self aslMessageReceived:msg]; - - // Keep track of which messages we've seen. - lastSeenID = (unsigned long long)atoll(asl_get(msg, ASL_KEY_MSG_ID)); - } - asl_release(response); - asl_free(query); - - if (_cancel) { - notify_cancel(token); - return; - } - - } - }); - } -} - -@end - -#endif diff --git a/Libs/ACommons/Lang/Logger/Lumberjack/DDASLLogger.h b/Libs/ACommons/Lang/Logger/Lumberjack/DDASLLogger.h deleted file mode 100755 index 15a1e0289..000000000 --- a/Libs/ACommons/Lang/Logger/Lumberjack/DDASLLogger.h +++ /dev/null @@ -1,59 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2018, Deusty, LLC -// All rights reserved. -// -// Redistribution and use of this software in source and binary forms, -// with or without modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Neither the name of Deusty nor the names of its contributors may be used -// to endorse or promote products derived from this software without specific -// prior written permission of Deusty, LLC. - -#import - -// Disable legacy macros -#ifndef DD_LEGACY_MACROS - #define DD_LEGACY_MACROS 0 -#endif - -#import "DDLog.h" - -// Custom key set on messages sent to ASL -extern const char* const kDDASLKeyDDLog; - -// Value set for kDDASLKeyDDLog -extern const char* const kDDASLDDLogValue; - -/** - * This class provides a logger for the Apple System Log facility. - * - * As described in the "Getting Started" page, - * the traditional NSLog() function directs its output to two places: - * - * - Apple System Log - * - StdErr (if stderr is a TTY) so log statements show up in Xcode console - * - * To duplicate NSLog() functionality you can simply add this logger and a tty logger. - * However, if you instead choose to use file logging (for faster performance), - * you may choose to use a file logger and a tty logger. - **/ -API_DEPRECATED("Use DDOSLogger instead", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)) -@interface DDASLLogger : DDAbstractLogger - -/** - * Singleton method - * - * @return the shared instance - */ -@property (class, readonly, strong) DDASLLogger *sharedInstance; - -// Inherited from DDAbstractLogger - -// - (id )logFormatter; -// - (void)setLogFormatter:(id )formatter; - -@end diff --git a/Libs/ACommons/Lang/Logger/Lumberjack/DDASLLogger.m b/Libs/ACommons/Lang/Logger/Lumberjack/DDASLLogger.m deleted file mode 100755 index be21bcfc6..000000000 --- a/Libs/ACommons/Lang/Logger/Lumberjack/DDASLLogger.m +++ /dev/null @@ -1,127 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2018, Deusty, LLC -// All rights reserved. -// -// Redistribution and use of this software in source and binary forms, -// with or without modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Neither the name of Deusty nor the names of its contributors may be used -// to endorse or promote products derived from this software without specific -// prior written permission of Deusty, LLC. - -#import "DDASLLogger.h" - -#import "DDLoggerNames.h" - -#if !TARGET_OS_WATCH -#import - -#if !__has_feature(objc_arc) -#error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). -#endif - -const char* const kDDASLKeyDDLog = "DDLog"; - -const char* const kDDASLDDLogValue = "1"; - -static DDASLLogger *sharedInstance; - -@interface DDASLLogger () { - aslclient _client; -} - -@end - - -@implementation DDASLLogger - -+ (instancetype)sharedInstance { - static dispatch_once_t DDASLLoggerOnceToken; - - dispatch_once(&DDASLLoggerOnceToken, ^{ - sharedInstance = [[[self class] alloc] init]; - }); - - return sharedInstance; -} - -- (instancetype)init { - if (sharedInstance != nil) { - return nil; - } - - if ((self = [super init])) { - // A default asl client is provided for the main thread, - // but background threads need to create their own client. - - _client = asl_open(NULL, "com.apple.console", 0); - } - - return self; -} - -- (void)logMessage:(DDLogMessage *)logMessage { - // Skip captured log messages - if ([logMessage->_fileName isEqualToString:@"DDASLLogCapture"]) { - return; - } - - NSString * message = _logFormatter ? [_logFormatter formatLogMessage:logMessage] : logMessage->_message; - - if (message) { - const char *msg = [message UTF8String]; - - size_t aslLogLevel; - switch (logMessage->_flag) { - // Note: By default ASL will filter anything above level 5 (Notice). - // So our mappings shouldn't go above that level. - case DDLogFlagError : aslLogLevel = ASL_LEVEL_CRIT; break; - case DDLogFlagWarning : aslLogLevel = ASL_LEVEL_ERR; break; - case DDLogFlagInfo : aslLogLevel = ASL_LEVEL_WARNING; break; // Regular NSLog's level - case DDLogFlagDebug : - case DDLogFlagVerbose : - default : aslLogLevel = ASL_LEVEL_NOTICE; break; - } - - static char const *const level_strings[] = { "0", "1", "2", "3", "4", "5", "6", "7" }; - - // NSLog uses the current euid to set the ASL_KEY_READ_UID. - uid_t const readUID = geteuid(); - - char readUIDString[16]; -#ifndef NS_BLOCK_ASSERTIONS - size_t l = (size_t)snprintf(readUIDString, sizeof(readUIDString), "%d", readUID); -#else - snprintf(readUIDString, sizeof(readUIDString), "%d", readUID); -#endif - - NSAssert(l < sizeof(readUIDString), - @"Formatted euid is too long."); - NSAssert(aslLogLevel < (sizeof(level_strings) / sizeof(level_strings[0])), - @"Unhandled ASL log level."); - - aslmsg m = asl_new(ASL_TYPE_MSG); - if (m != NULL) { - if (asl_set(m, ASL_KEY_LEVEL, level_strings[aslLogLevel]) == 0 && - asl_set(m, ASL_KEY_MSG, msg) == 0 && - asl_set(m, ASL_KEY_READ_UID, readUIDString) == 0 && - asl_set(m, kDDASLKeyDDLog, kDDASLDDLogValue) == 0) { - asl_send(_client, m); - } - asl_free(m); - } - //TODO handle asl_* failures non-silently? - } -} - -- (DDLoggerName)loggerName { - return DDLoggerNameASL; -} - -@end - -#endif diff --git a/Libs/ACommons/Lang/Logger/Lumberjack/DDAbstractDatabaseLogger.h b/Libs/ACommons/Lang/Logger/Lumberjack/DDAbstractDatabaseLogger.h deleted file mode 100755 index 4ad15ec90..000000000 --- a/Libs/ACommons/Lang/Logger/Lumberjack/DDAbstractDatabaseLogger.h +++ /dev/null @@ -1,123 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2018, Deusty, LLC -// All rights reserved. -// -// Redistribution and use of this software in source and binary forms, -// with or without modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Neither the name of Deusty nor the names of its contributors may be used -// to endorse or promote products derived from this software without specific -// prior written permission of Deusty, LLC. - -// Disable legacy macros -#ifndef DD_LEGACY_MACROS - #define DD_LEGACY_MACROS 0 -#endif - -#import "DDLog.h" - -/** - * This class provides an abstract implementation of a database logger. - * - * That is, it provides the base implementation for a database logger to build atop of. - * All that is needed for a concrete database logger is to extend this class - * and override the methods in the implementation file that are prefixed with "db_". - **/ -@interface DDAbstractDatabaseLogger : DDAbstractLogger { - -@protected - NSUInteger _saveThreshold; - NSTimeInterval _saveInterval; - NSTimeInterval _maxAge; - NSTimeInterval _deleteInterval; - BOOL _deleteOnEverySave; - - BOOL _saveTimerSuspended; - NSUInteger _unsavedCount; - dispatch_time_t _unsavedTime; - dispatch_source_t _saveTimer; - dispatch_time_t _lastDeleteTime; - dispatch_source_t _deleteTimer; -} - -/** - * Specifies how often to save the data to disk. - * Since saving is an expensive operation (disk io) it is not done after every log statement. - * These properties allow you to configure how/when the logger saves to disk. - * - * A save is done when either (whichever happens first): - * - * - The number of unsaved log entries reaches saveThreshold - * - The amount of time since the oldest unsaved log entry was created reaches saveInterval - * - * You can optionally disable the saveThreshold by setting it to zero. - * If you disable the saveThreshold you are entirely dependent on the saveInterval. - * - * You can optionally disable the saveInterval by setting it to zero (or a negative value). - * If you disable the saveInterval you are entirely dependent on the saveThreshold. - * - * It's not wise to disable both saveThreshold and saveInterval. - * - * The default saveThreshold is 500. - * The default saveInterval is 60 seconds. - **/ -@property (assign, readwrite) NSUInteger saveThreshold; - -/** - * See the description for the `saveThreshold` property - */ -@property (assign, readwrite) NSTimeInterval saveInterval; - -/** - * It is likely you don't want the log entries to persist forever. - * Doing so would allow the database to grow infinitely large over time. - * - * The maxAge property provides a way to specify how old a log statement can get - * before it should get deleted from the database. - * - * The deleteInterval specifies how often to sweep for old log entries. - * Since deleting is an expensive operation (disk io) is is done on a fixed interval. - * - * An alternative to the deleteInterval is the deleteOnEverySave option. - * This specifies that old log entries should be deleted during every save operation. - * - * You can optionally disable the maxAge by setting it to zero (or a negative value). - * If you disable the maxAge then old log statements are not deleted. - * - * You can optionally disable the deleteInterval by setting it to zero (or a negative value). - * - * If you disable both deleteInterval and deleteOnEverySave then old log statements are not deleted. - * - * It's not wise to enable both deleteInterval and deleteOnEverySave. - * - * The default maxAge is 7 days. - * The default deleteInterval is 5 minutes. - * The default deleteOnEverySave is NO. - **/ -@property (assign, readwrite) NSTimeInterval maxAge; - -/** - * See the description for the `maxAge` property - */ -@property (assign, readwrite) NSTimeInterval deleteInterval; - -/** - * See the description for the `maxAge` property - */ -@property (assign, readwrite) BOOL deleteOnEverySave; - -/** - * Forces a save of any pending log entries (flushes log entries to disk). - **/ -- (void)savePendingLogEntries; - -/** - * Removes any log entries that are older than maxAge. - **/ -- (void)deleteOldLogEntries; - -@end diff --git a/Libs/ACommons/Lang/Logger/Lumberjack/DDAbstractDatabaseLogger.m b/Libs/ACommons/Lang/Logger/Lumberjack/DDAbstractDatabaseLogger.m deleted file mode 100755 index 6849a7373..000000000 --- a/Libs/ACommons/Lang/Logger/Lumberjack/DDAbstractDatabaseLogger.m +++ /dev/null @@ -1,660 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2018, Deusty, LLC -// All rights reserved. -// -// Redistribution and use of this software in source and binary forms, -// with or without modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Neither the name of Deusty nor the names of its contributors may be used -// to endorse or promote products derived from this software without specific -// prior written permission of Deusty, LLC. - -#import "DDAbstractDatabaseLogger.h" -#import - - -#if !__has_feature(objc_arc) -#error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). -#endif - -@interface DDAbstractDatabaseLogger () - -- (void)destroySaveTimer; -- (void)destroyDeleteTimer; - -@end - -#pragma mark - - -@implementation DDAbstractDatabaseLogger - -- (instancetype)init { - if ((self = [super init])) { - _saveThreshold = 500; - _saveInterval = 60; // 60 seconds - _maxAge = (60 * 60 * 24 * 7); // 7 days - _deleteInterval = (60 * 5); // 5 minutes - } - - return self; -} - -- (void)dealloc { - [self destroySaveTimer]; - [self destroyDeleteTimer]; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma mark Override Me -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -- (BOOL)db_log:(__unused DDLogMessage *)logMessage { - // Override me and add your implementation. - // - // Return YES if an item was added to the buffer. - // Return NO if the logMessage was ignored. - - return NO; -} - -- (void)db_save { - // Override me and add your implementation. -} - -- (void)db_delete { - // Override me and add your implementation. -} - -- (void)db_saveAndDelete { - // Override me and add your implementation. -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma mark Private API -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -- (void)performSaveAndSuspendSaveTimer { - if (_unsavedCount > 0) { - if (_deleteOnEverySave) { - [self db_saveAndDelete]; - } else { - [self db_save]; - } - } - - _unsavedCount = 0; - _unsavedTime = 0; - - if (_saveTimer && !_saveTimerSuspended) { - dispatch_suspend(_saveTimer); - _saveTimerSuspended = YES; - } -} - -- (void)performDelete { - if (_maxAge > 0.0) { - [self db_delete]; - - _lastDeleteTime = dispatch_time(DISPATCH_TIME_NOW, 0); - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma mark Timers -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -- (void)destroySaveTimer { - if (_saveTimer) { - dispatch_source_cancel(_saveTimer); - - if (_saveTimerSuspended) { - // Must resume a timer before releasing it (or it will crash) - dispatch_resume(_saveTimer); - _saveTimerSuspended = NO; - } - - #if !OS_OBJECT_USE_OBJC - dispatch_release(_saveTimer); - #endif - _saveTimer = NULL; - } -} - -- (void)updateAndResumeSaveTimer { - if ((_saveTimer != NULL) && (_saveInterval > 0.0) && (_unsavedTime > 0.0)) { - uint64_t interval = (uint64_t)(_saveInterval * (NSTimeInterval) NSEC_PER_SEC); - dispatch_time_t startTime = dispatch_time(_unsavedTime, (int64_t)interval); - - dispatch_source_set_timer(_saveTimer, startTime, interval, 1ull * NSEC_PER_SEC); - - if (_saveTimerSuspended) { - dispatch_resume(_saveTimer); - _saveTimerSuspended = NO; - } - } -} - -- (void)createSuspendedSaveTimer { - if ((_saveTimer == NULL) && (_saveInterval > 0.0)) { - _saveTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, self.loggerQueue); - - dispatch_source_set_event_handler(_saveTimer, ^{ @autoreleasepool { - [self performSaveAndSuspendSaveTimer]; - } }); - - _saveTimerSuspended = YES; - } -} - -- (void)destroyDeleteTimer { - if (_deleteTimer) { - dispatch_source_cancel(_deleteTimer); - #if !OS_OBJECT_USE_OBJC - dispatch_release(_deleteTimer); - #endif - _deleteTimer = NULL; - } -} - -- (void)updateDeleteTimer { - if ((_deleteTimer != NULL) && (_deleteInterval > 0.0) && (_maxAge > 0.0)) { - int64_t interval = (int64_t)(_deleteInterval * (NSTimeInterval) NSEC_PER_SEC); - dispatch_time_t startTime; - - if (_lastDeleteTime > 0) { - startTime = dispatch_time(_lastDeleteTime, interval); - } else { - startTime = dispatch_time(DISPATCH_TIME_NOW, interval); - } - - dispatch_source_set_timer(_deleteTimer, startTime, (uint64_t)interval, 1ull * NSEC_PER_SEC); - } -} - -- (void)createAndStartDeleteTimer { - if ((_deleteTimer == NULL) && (_deleteInterval > 0.0) && (_maxAge > 0.0)) { - _deleteTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, self.loggerQueue); - - if (_deleteTimer != NULL) { - dispatch_source_set_event_handler(_deleteTimer, ^{ @autoreleasepool { - [self performDelete]; - } }); - - [self updateDeleteTimer]; - - if (_deleteTimer != NULL) { - dispatch_resume(_deleteTimer); - } - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma mark Configuration -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -- (NSUInteger)saveThreshold { - // The design of this method is taken from the DDAbstractLogger implementation. - // For extensive documentation please refer to the DDAbstractLogger implementation. - - // Note: The internal implementation MUST access the colorsEnabled variable directly, - // This method is designed explicitly for external access. - // - // Using "self." syntax to go through this method will cause immediate deadlock. - // This is the intended result. Fix it by accessing the ivar directly. - // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster. - - NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure"); - NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax."); - - dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue]; - - __block NSUInteger result; - - dispatch_sync(globalLoggingQueue, ^{ - dispatch_sync(self.loggerQueue, ^{ - result = self->_saveThreshold; - }); - }); - - return result; -} - -- (void)setSaveThreshold:(NSUInteger)threshold { - dispatch_block_t block = ^{ - @autoreleasepool { - if (self->_saveThreshold != threshold) { - self->_saveThreshold = threshold; - - // Since the saveThreshold has changed, - // we check to see if the current unsavedCount has surpassed the new threshold. - // - // If it has, we immediately save the log. - - if ((self->_unsavedCount >= self->_saveThreshold) && (self->_saveThreshold > 0)) { - [self performSaveAndSuspendSaveTimer]; - } - } - } - }; - - // The design of the setter logic below is taken from the DDAbstractLogger implementation. - // For documentation please refer to the DDAbstractLogger implementation. - - if ([self isOnInternalLoggerQueue]) { - block(); - } else { - dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue]; - NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure"); - - dispatch_async(globalLoggingQueue, ^{ - dispatch_async(self.loggerQueue, block); - }); - } -} - -- (NSTimeInterval)saveInterval { - // The design of this method is taken from the DDAbstractLogger implementation. - // For extensive documentation please refer to the DDAbstractLogger implementation. - - // Note: The internal implementation MUST access the colorsEnabled variable directly, - // This method is designed explicitly for external access. - // - // Using "self." syntax to go through this method will cause immediate deadlock. - // This is the intended result. Fix it by accessing the ivar directly. - // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster. - - NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure"); - NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax."); - - dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue]; - - __block NSTimeInterval result; - - dispatch_sync(globalLoggingQueue, ^{ - dispatch_sync(self.loggerQueue, ^{ - result = self->_saveInterval; - }); - }); - - return result; -} - -- (void)setSaveInterval:(NSTimeInterval)interval { - dispatch_block_t block = ^{ - @autoreleasepool { - // C99 recommended floating point comparison macro - // Read: isLessThanOrGreaterThan(floatA, floatB) - - if (/* saveInterval != interval */ islessgreater(self->_saveInterval, interval)) { - self->_saveInterval = interval; - - // There are several cases we need to handle here. - // - // 1. If the saveInterval was previously enabled and it just got disabled, - // then we need to stop the saveTimer. (And we might as well release it.) - // - // 2. If the saveInterval was previously disabled and it just got enabled, - // then we need to setup the saveTimer. (Plus we might need to do an immediate save.) - // - // 3. If the saveInterval increased, then we need to reset the timer so that it fires at the later date. - // - // 4. If the saveInterval decreased, then we need to reset the timer so that it fires at an earlier date. - // (Plus we might need to do an immediate save.) - - if (self->_saveInterval > 0.0) { - if (self->_saveTimer == NULL) { - // Handles #2 - // - // Since the saveTimer uses the unsavedTime to calculate it's first fireDate, - // if a save is needed the timer will fire immediately. - - [self createSuspendedSaveTimer]; - [self updateAndResumeSaveTimer]; - } else { - // Handles #3 - // Handles #4 - // - // Since the saveTimer uses the unsavedTime to calculate it's first fireDate, - // if a save is needed the timer will fire immediately. - - [self updateAndResumeSaveTimer]; - } - } else if (self->_saveTimer) { - // Handles #1 - - [self destroySaveTimer]; - } - } - } - }; - - // The design of the setter logic below is taken from the DDAbstractLogger implementation. - // For documentation please refer to the DDAbstractLogger implementation. - - if ([self isOnInternalLoggerQueue]) { - block(); - } else { - dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue]; - NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure"); - - dispatch_async(globalLoggingQueue, ^{ - dispatch_async(self.loggerQueue, block); - }); - } -} - -- (NSTimeInterval)maxAge { - // The design of this method is taken from the DDAbstractLogger implementation. - // For extensive documentation please refer to the DDAbstractLogger implementation. - - // Note: The internal implementation MUST access the colorsEnabled variable directly, - // This method is designed explicitly for external access. - // - // Using "self." syntax to go through this method will cause immediate deadlock. - // This is the intended result. Fix it by accessing the ivar directly. - // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster. - - NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure"); - NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax."); - - dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue]; - - __block NSTimeInterval result; - - dispatch_sync(globalLoggingQueue, ^{ - dispatch_sync(self.loggerQueue, ^{ - result = self->_maxAge; - }); - }); - - return result; -} - -- (void)setMaxAge:(NSTimeInterval)interval { - dispatch_block_t block = ^{ - @autoreleasepool { - // C99 recommended floating point comparison macro - // Read: isLessThanOrGreaterThan(floatA, floatB) - - if (/* maxAge != interval */ islessgreater(self->_maxAge, interval)) { - NSTimeInterval oldMaxAge = self->_maxAge; - NSTimeInterval newMaxAge = interval; - - self->_maxAge = interval; - - // There are several cases we need to handle here. - // - // 1. If the maxAge was previously enabled and it just got disabled, - // then we need to stop the deleteTimer. (And we might as well release it.) - // - // 2. If the maxAge was previously disabled and it just got enabled, - // then we need to setup the deleteTimer. (Plus we might need to do an immediate delete.) - // - // 3. If the maxAge was increased, - // then we don't need to do anything. - // - // 4. If the maxAge was decreased, - // then we should do an immediate delete. - - BOOL shouldDeleteNow = NO; - - if (oldMaxAge > 0.0) { - if (newMaxAge <= 0.0) { - // Handles #1 - - [self destroyDeleteTimer]; - } else if (oldMaxAge > newMaxAge) { - // Handles #4 - shouldDeleteNow = YES; - } - } else if (newMaxAge > 0.0) { - // Handles #2 - shouldDeleteNow = YES; - } - - if (shouldDeleteNow) { - [self performDelete]; - - if (self->_deleteTimer) { - [self updateDeleteTimer]; - } else { - [self createAndStartDeleteTimer]; - } - } - } - } - }; - - // The design of the setter logic below is taken from the DDAbstractLogger implementation. - // For documentation please refer to the DDAbstractLogger implementation. - - if ([self isOnInternalLoggerQueue]) { - block(); - } else { - dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue]; - NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure"); - - dispatch_async(globalLoggingQueue, ^{ - dispatch_async(self.loggerQueue, block); - }); - } -} - -- (NSTimeInterval)deleteInterval { - // The design of this method is taken from the DDAbstractLogger implementation. - // For extensive documentation please refer to the DDAbstractLogger implementation. - - // Note: The internal implementation MUST access the colorsEnabled variable directly, - // This method is designed explicitly for external access. - // - // Using "self." syntax to go through this method will cause immediate deadlock. - // This is the intended result. Fix it by accessing the ivar directly. - // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster. - - NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure"); - NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax."); - - dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue]; - - __block NSTimeInterval result; - - dispatch_sync(globalLoggingQueue, ^{ - dispatch_sync(self.loggerQueue, ^{ - result = self->_deleteInterval; - }); - }); - - return result; -} - -- (void)setDeleteInterval:(NSTimeInterval)interval { - dispatch_block_t block = ^{ - @autoreleasepool { - // C99 recommended floating point comparison macro - // Read: isLessThanOrGreaterThan(floatA, floatB) - - if (/* deleteInterval != interval */ islessgreater(self->_deleteInterval, interval)) { - self->_deleteInterval = interval; - - // There are several cases we need to handle here. - // - // 1. If the deleteInterval was previously enabled and it just got disabled, - // then we need to stop the deleteTimer. (And we might as well release it.) - // - // 2. If the deleteInterval was previously disabled and it just got enabled, - // then we need to setup the deleteTimer. (Plus we might need to do an immediate delete.) - // - // 3. If the deleteInterval increased, then we need to reset the timer so that it fires at the later date. - // - // 4. If the deleteInterval decreased, then we need to reset the timer so that it fires at an earlier date. - // (Plus we might need to do an immediate delete.) - - if (self->_deleteInterval > 0.0) { - if (self->_deleteTimer == NULL) { - // Handles #2 - // - // Since the deleteTimer uses the lastDeleteTime to calculate it's first fireDate, - // if a delete is needed the timer will fire immediately. - - [self createAndStartDeleteTimer]; - } else { - // Handles #3 - // Handles #4 - // - // Since the deleteTimer uses the lastDeleteTime to calculate it's first fireDate, - // if a save is needed the timer will fire immediately. - - [self updateDeleteTimer]; - } - } else if (self->_deleteTimer) { - // Handles #1 - - [self destroyDeleteTimer]; - } - } - } - }; - - // The design of the setter logic below is taken from the DDAbstractLogger implementation. - // For documentation please refer to the DDAbstractLogger implementation. - - if ([self isOnInternalLoggerQueue]) { - block(); - } else { - dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue]; - NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure"); - - dispatch_async(globalLoggingQueue, ^{ - dispatch_async(self.loggerQueue, block); - }); - } -} - -- (BOOL)deleteOnEverySave { - // The design of this method is taken from the DDAbstractLogger implementation. - // For extensive documentation please refer to the DDAbstractLogger implementation. - - // Note: The internal implementation MUST access the colorsEnabled variable directly, - // This method is designed explicitly for external access. - // - // Using "self." syntax to go through this method will cause immediate deadlock. - // This is the intended result. Fix it by accessing the ivar directly. - // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster. - - NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure"); - NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax."); - - dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue]; - - __block BOOL result; - - dispatch_sync(globalLoggingQueue, ^{ - dispatch_sync(self.loggerQueue, ^{ - result = self->_deleteOnEverySave; - }); - }); - - return result; -} - -- (void)setDeleteOnEverySave:(BOOL)flag { - dispatch_block_t block = ^{ - self->_deleteOnEverySave = flag; - }; - - // The design of the setter logic below is taken from the DDAbstractLogger implementation. - // For documentation please refer to the DDAbstractLogger implementation. - - if ([self isOnInternalLoggerQueue]) { - block(); - } else { - dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue]; - NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure"); - - dispatch_async(globalLoggingQueue, ^{ - dispatch_async(self.loggerQueue, block); - }); - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma mark Public API -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -- (void)savePendingLogEntries { - dispatch_block_t block = ^{ - @autoreleasepool { - [self performSaveAndSuspendSaveTimer]; - } - }; - - if ([self isOnInternalLoggerQueue]) { - block(); - } else { - dispatch_async(self.loggerQueue, block); - } -} - -- (void)deleteOldLogEntries { - dispatch_block_t block = ^{ - @autoreleasepool { - [self performDelete]; - } - }; - - if ([self isOnInternalLoggerQueue]) { - block(); - } else { - dispatch_async(self.loggerQueue, block); - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma mark DDLogger -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -- (void)didAddLogger { - // If you override me be sure to invoke [super didAddLogger]; - - [self createSuspendedSaveTimer]; - - [self createAndStartDeleteTimer]; -} - -- (void)willRemoveLogger { - // If you override me be sure to invoke [super willRemoveLogger]; - - [self performSaveAndSuspendSaveTimer]; - - [self destroySaveTimer]; - [self destroyDeleteTimer]; -} - -- (void)logMessage:(DDLogMessage *)logMessage { - if ([self db_log:logMessage]) { - BOOL firstUnsavedEntry = (++_unsavedCount == 1); - - if ((_unsavedCount >= _saveThreshold) && (_saveThreshold > 0)) { - [self performSaveAndSuspendSaveTimer]; - } else if (firstUnsavedEntry) { - _unsavedTime = dispatch_time(DISPATCH_TIME_NOW, 0); - [self updateAndResumeSaveTimer]; - } - } -} - -- (void)flush { - // This method is invoked by DDLog's flushLog method. - // - // It is called automatically when the application quits, - // or if the developer invokes DDLog's flushLog method prior to crashing or something. - - [self performSaveAndSuspendSaveTimer]; -} - -@end diff --git a/Libs/ACommons/Lang/Logger/Lumberjack/DDAssert.swift b/Libs/ACommons/Lang/Logger/Lumberjack/DDAssert.swift deleted file mode 100755 index 6744b44c2..000000000 --- a/Libs/ACommons/Lang/Logger/Lumberjack/DDAssert.swift +++ /dev/null @@ -1,46 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2018, Deusty, LLC -// All rights reserved. -// -// Redistribution and use of this software in source and binary forms, -// with or without modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Neither the name of Deusty nor the names of its contributors may be used -// to endorse or promote products derived from this software without specific -// prior written permission of Deusty, LLC. - -/** - * Replacement for Swift's `assert` function that will output a log message even when assertions - * are disabled. - * - * - Parameters: - * - condition: The condition to test. Unlike `Swift.assert`, `condition` is always evaluated, - * even when assertions are disabled. - * - message: A string to log (using `DDLogError`) if `condition` evaluates to `false`. - * The default is an empty string. - */ - -@inlinable -public func DDAssert(_ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String = "", level: DDLogLevel = DDDefaultLogLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: Any? = nil, asynchronous async: Bool = false, ddlog: DDLog = DDLog.sharedInstance) { - if !condition() { - DDLogError(message, level: level, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog) - Swift.assertionFailure(message, file: file, line: line) - } -} - -/** - * Replacement for Swift's `assertionFailure` function that will output a log message even - * when assertions are disabled. - * - * - Parameters: - * - message: A string to log (using `DDLogError`). The default is an empty string. - */ -@inlinable -public func DDAssertionFailure(_ message: @autoclosure () -> String = "", level: DDLogLevel = DDDefaultLogLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: Any? = nil, asynchronous async: Bool = false, ddlog: DDLog = DDLog.sharedInstance) { - DDLogError(message, level: level, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog) - Swift.assertionFailure(message, file: file, line: line) -} diff --git a/Libs/ACommons/Lang/Logger/Lumberjack/DDAssertMacros.h b/Libs/ACommons/Lang/Logger/Lumberjack/DDAssertMacros.h deleted file mode 100755 index bce1fbcda..000000000 --- a/Libs/ACommons/Lang/Logger/Lumberjack/DDAssertMacros.h +++ /dev/null @@ -1,26 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2018, Deusty, LLC -// All rights reserved. -// -// Redistribution and use of this software in source and binary forms, -// with or without modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Neither the name of Deusty nor the names of its contributors may be used -// to endorse or promote products derived from this software without specific -// prior written permission of Deusty, LLC. - -/** - * NSAssert replacement that will output a log message even when assertions are disabled. - **/ -#define DDAssert(condition, frmt, ...) \ - if (!(condition)) { \ - NSString *description = [NSString stringWithFormat:frmt, ## __VA_ARGS__]; \ - DDLogError(@"%@", description); \ - NSAssert(NO, description); \ - } -#define DDAssertCondition(condition) DDAssert(condition, @"Condition not satisfied: %s", #condition) - diff --git a/Libs/ACommons/Lang/Logger/Lumberjack/DDFileLogger.h b/Libs/ACommons/Lang/Logger/Lumberjack/DDFileLogger.h deleted file mode 100755 index ea8580e32..000000000 --- a/Libs/ACommons/Lang/Logger/Lumberjack/DDFileLogger.h +++ /dev/null @@ -1,517 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2018, Deusty, LLC -// All rights reserved. -// -// Redistribution and use of this software in source and binary forms, -// with or without modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Neither the name of Deusty nor the names of its contributors may be used -// to endorse or promote products derived from this software without specific -// prior written permission of Deusty, LLC. - -// Disable legacy macros -#ifndef DD_LEGACY_MACROS - #define DD_LEGACY_MACROS 0 -#endif - -#import "DDLog.h" - -@class DDLogFileInfo; - -/** - * This class provides a logger to write log statements to a file. - **/ - - -// Default configuration and safety/sanity values. -// -// maximumFileSize -> kDDDefaultLogMaxFileSize -// rollingFrequency -> kDDDefaultLogRollingFrequency -// maximumNumberOfLogFiles -> kDDDefaultLogMaxNumLogFiles -// logFilesDiskQuota -> kDDDefaultLogFilesDiskQuota -// -// You should carefully consider the proper configuration values for your application. - -extern unsigned long long const kDDDefaultLogMaxFileSize; -extern NSTimeInterval const kDDDefaultLogRollingFrequency; -extern NSUInteger const kDDDefaultLogMaxNumLogFiles; -extern unsigned long long const kDDDefaultLogFilesDiskQuota; - - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma mark - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** - * The LogFileManager protocol is designed to allow you to control all aspects of your log files. - * - * The primary purpose of this is to allow you to do something with the log files after they have been rolled. - * Perhaps you want to compress them to save disk space. - * Perhaps you want to upload them to an FTP server. - * Perhaps you want to run some analytics on the file. - * - * A default LogFileManager is, of course, provided. - * The default LogFileManager simply deletes old log files according to the maximumNumberOfLogFiles property. - * - * This protocol provides various methods to fetch the list of log files. - * - * There are two variants: sorted and unsorted. - * If sorting is not necessary, the unsorted variant is obviously faster. - * The sorted variant will return an array sorted by when the log files were created, - * with the most recently created log file at index 0, and the oldest log file at the end of the array. - * - * You can fetch only the log file paths (full path including name), log file names (name only), - * or an array of `DDLogFileInfo` objects. - * The `DDLogFileInfo` class is documented below, and provides a handy wrapper that - * gives you easy access to various file attributes such as the creation date or the file size. - */ -@protocol DDLogFileManager -@required - -// Public properties - -/** - * The maximum number of archived log files to keep on disk. - * For example, if this property is set to 3, - * then the LogFileManager will only keep 3 archived log files (plus the current active log file) on disk. - * Once the active log file is rolled/archived, then the oldest of the existing 3 rolled/archived log files is deleted. - * - * You may optionally disable this option by setting it to zero. - **/ -@property (readwrite, assign, atomic) NSUInteger maximumNumberOfLogFiles; - -/** - * The maximum space that logs can take. On rolling logfile all old logfiles that exceed logFilesDiskQuota will - * be deleted. - * - * You may optionally disable this option by setting it to zero. - **/ -@property (readwrite, assign, atomic) unsigned long long logFilesDiskQuota; - -// Public methods - -/** - * Returns the logs directory (path) - */ -@property (nonatomic, readonly, copy) NSString *logsDirectory; - -/** - * Returns an array of `NSString` objects, - * each of which is the filePath to an existing log file on disk. - **/ -@property (nonatomic, readonly, strong) NSArray *unsortedLogFilePaths; - -/** - * Returns an array of `NSString` objects, - * each of which is the fileName of an existing log file on disk. - **/ -@property (nonatomic, readonly, strong) NSArray *unsortedLogFileNames; - -/** - * Returns an array of `DDLogFileInfo` objects, - * each representing an existing log file on disk, - * and containing important information about the log file such as it's modification date and size. - **/ -@property (nonatomic, readonly, strong) NSArray *unsortedLogFileInfos; - -/** - * Just like the `unsortedLogFilePaths` method, but sorts the array. - * The items in the array are sorted by creation date. - * The first item in the array will be the most recently created log file. - **/ -@property (nonatomic, readonly, strong) NSArray *sortedLogFilePaths; - -/** - * Just like the `unsortedLogFileNames` method, but sorts the array. - * The items in the array are sorted by creation date. - * The first item in the array will be the most recently created log file. - **/ -@property (nonatomic, readonly, strong) NSArray *sortedLogFileNames; - -/** - * Just like the `unsortedLogFileInfos` method, but sorts the array. - * The items in the array are sorted by creation date. - * The first item in the array will be the most recently created log file. - **/ -@property (nonatomic, readonly, strong) NSArray *sortedLogFileInfos; - -// Private methods (only to be used by DDFileLogger) - -/** - * Generates a new unique log file path, and creates the corresponding log file. - **/ -- (NSString *)createNewLogFile; - -@optional - -// Notifications from DDFileLogger - -/** - * Called when a log file was archieved - */ -- (void)didArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didArchiveLogFile(atPath:)); - -/** - * Called when the roll action was executed and the log was archieved - */ -- (void)didRollAndArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didRollAndArchiveLogFile(atPath:)); - -@end - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma mark - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** - * Default log file manager. - * - * All log files are placed inside the logsDirectory. - * If a specific logsDirectory isn't specified, the default directory is used. - * On Mac, this is in `~/Library/Logs/`. - * On iPhone, this is in `~/Library/Caches/Logs`. - * - * Log files are named `"