Эх сурвалжийг харах

Cleanup GTM dependency from Firebase performance since we don't need log filters anymore (#7230)

Visu 5 жил өмнө
parent
commit
ac270f9e30

+ 0 - 2
FirebasePerformance.podspec

@@ -60,8 +60,6 @@ Firebase Performance library to measure performance of Mobile and Web Apps.
   s.dependency 'FirebaseInstallations', '~> 7.0'
   s.dependency 'FirebaseRemoteConfig', '~> 7.0'
   s.dependency 'GoogleDataTransport', '~> 8.2'
-  s.dependency 'GTMSessionFetcher/Core', '~> 1.1'
-  s.dependency 'GoogleToolboxForMac/Logger', '~> 2.1'
   s.dependency 'GoogleUtilities/Environment', '~> 7.0'
   s.dependency 'GoogleUtilities/ISASwizzler', '~> 7.0'
   s.dependency 'GoogleUtilities/MethodSwizzler', '~> 7.0'

+ 4 - 0
FirebasePerformance/CHANGELOG.md

@@ -1,3 +1,7 @@
+# Version 7.4.0
+* Make FirebasePerformance open source.
+* Remove GoogleToolboxForMac and GTMSessionFetcher dependencies.
+
 # Version 7.3.0
 * Add blocklist for GoogleDataTransport upload URLs.
 * Update the event transport mechanism to open sourced GoogleDataTransport.

+ 0 - 22
FirebasePerformance/Sources/Common/FPRGTMLogLevelFilter.h

@@ -1,22 +0,0 @@
-// Copyright 2020 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#import <GoogleToolboxForMac/GTMLogger.h>
-
-/**
- * A log level filter to control the console log messages generated from GTMLogger.
- */
-@interface FPRGTMLogLevelFilter : GTMLogLevelFilter
-
-@end

+ 0 - 36
FirebasePerformance/Sources/Common/FPRGTMLogLevelFilter.m

@@ -1,36 +0,0 @@
-// Copyright 2020 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#import "FirebasePerformance/Sources/Common/FPRGTMLogLevelFilter.h"
-
-@implementation FPRGTMLogLevelFilter
-
-/**
- * Checks if the log messages received should be allowed to be shown in the console logs or not.
- *
- * @param message Log message received.
- * @param level Log level as defined in GTMLoggerLevel.
- * @return YES if message should be logged by GTMLogger. NO, otherwise.
- */
-- (BOOL)filterAllowsMessage:(NSString *)message level:(GTMLoggerLevel)level {
-  // GMVGIPPseudonymousIDStore is the prefix of log messages generated by GIPPseudonymousIDStore.
-  if (message) {
-    if ([message rangeOfString:@"[GMVGIPPseudonymousIDStore"].location != NSNotFound) {
-      return NO;
-    }
-  }
-  return YES;
-}
-
-@end

+ 0 - 4
FirebasePerformance/Sources/FPRClient.m

@@ -20,7 +20,6 @@
 #import "FirebasePerformance/Sources/AppActivity/FPRSessionManager+Private.h"
 #import "FirebasePerformance/Sources/AppActivity/FPRTraceBackgroundActivityTracker.h"
 #import "FirebasePerformance/Sources/Common/FPRConstants.h"
-#import "FirebasePerformance/Sources/Common/FPRGTMLogLevelFilter.h"
 #import "FirebasePerformance/Sources/Configurations/FPRConfigurations.h"
 #import "FirebasePerformance/Sources/Configurations/FPRRemoteConfigFlags.h"
 #import "FirebasePerformance/Sources/FPRConsoleLogger.h"
@@ -32,8 +31,6 @@
 
 #import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h"
 
-#import <GoogleToolboxForMac/GTMLogger.h>
-
 #import "FirebasePerformance/ProtoSupport/PerfMetric.pbobjc.h"
 
 @interface FPRClient ()
@@ -110,7 +107,6 @@
     _eventsQueue = dispatch_queue_create("com.google.perf.FPREventsQueue", DISPATCH_QUEUE_SERIAL);
     _eventsQueueGroup = dispatch_group_create();
     _configuration = [FPRConfigurations sharedInstance];
-    [[GTMLogger sharedLogger] setFilter:[[FPRGTMLogLevelFilter alloc] init]];
   }
   return self;
 }

+ 0 - 55
FirebasePerformance/Tests/Unit/Common/FPRGTMLogLevelFilterTest.m

@@ -1,55 +0,0 @@
-// Copyright 2020 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#import <XCTest/XCTest.h>
-
-#import "FirebasePerformance/Sources/Common/FPRGTMLogLevelFilter.h"
-
-@interface FPRGTMLogLevelFilterTest : XCTestCase
-
-@property(nonatomic) FPRGTMLogLevelFilter *logFilter;
-
-@end
-
-@implementation FPRGTMLogLevelFilterTest
-
-- (void)setUp {
-  [super setUp];
-  self.logFilter = [[FPRGTMLogLevelFilter alloc] init];
-}
-
-- (void)tearDown {
-  [super tearDown];
-  self.logFilter = nil;
-}
-
-/** Validates that instance creation does not fail. */
-- (void)testInstanceCreation {
-  XCTAssertNotNil(self.logFilter);
-}
-
-/** Validates that PseudonymousIDStore messages are dropped. */
-- (void)testPseudonymousIDStoreLogMessagesAreDropped {
-  XCTAssertFalse([self.logFilter
-      filterAllowsMessage:@"-[GMVGIPPseudonymousIDStore initializeStorage] message"
-                    level:kGTMLoggerLevelError]);
-}
-
-/** Validates that valid messages are not dropped. */
-- (void)testValidLogMessagesAreNotDropped {
-  NSString *logMessage = @"<Error> [Firebase/InstanceID][I-IID010003] Unable to generate keypair.";
-  XCTAssertTrue([self.logFilter filterAllowsMessage:logMessage level:kGTMLoggerLevelError]);
-}
-
-@end