diff options
author | Jason Wray <jason@mapbox.com> | 2019-08-20 16:17:02 -0700 |
---|---|---|
committer | Jason Wray <friedbunny@users.noreply.github.com> | 2019-08-21 12:14:20 -0700 |
commit | c4f992e4896230c66663cf82cfa9dcbacb391663 (patch) | |
tree | efd78136e41fb4cef85eca74c3e7a9c3a67198fe | |
parent | 0e57c7de4401ed67854b64b1bbc26edf04e2e07c (diff) | |
download | qtlocation-mapboxgl-c4f992e4896230c66663cf82cfa9dcbacb391663.tar.gz |
[ios] Remove obsolete iosapp telemetry debug logging
This has been superceded by features in the standalone events library.
-rw-r--r-- | platform/ios/app/MBXState.h | 2 | ||||
-rw-r--r-- | platform/ios/app/MBXState.m | 5 | ||||
-rw-r--r-- | platform/ios/app/MBXViewController.m | 53 |
3 files changed, 0 insertions, 60 deletions
diff --git a/platform/ios/app/MBXState.h b/platform/ios/app/MBXState.h index 7cf064acd8..346c31d586 100644 --- a/platform/ios/app/MBXState.h +++ b/platform/ios/app/MBXState.h @@ -12,7 +12,6 @@ FOUNDATION_EXTERN NSString *const MBXShowsZoomLevelOrnament; FOUNDATION_EXTERN NSString *const MBXShowsTimeFrameGraph; FOUNDATION_EXTERN NSString *const MBXMapFramerateMeasurementEnabled; FOUNDATION_EXTERN NSString *const MBXDebugMaskValue; -FOUNDATION_EXTERN NSString *const MBXDebugLoggingEnabled; FOUNDATION_EXTERN NSString *const MBXReuseQueueStatsEnabled; @interface MBXState : NSObject <NSSecureCoding> @@ -26,7 +25,6 @@ FOUNDATION_EXTERN NSString *const MBXReuseQueueStatsEnabled; @property (nonatomic) BOOL showsTimeFrameGraph; @property (nonatomic) BOOL framerateMeasurementEnabled; @property (nonatomic) MGLMapDebugMaskOptions debugMask; -@property (nonatomic) BOOL debugLoggingEnabled; @property (nonatomic) BOOL reuseQueueStatsEnabled; @property (nonatomic, readonly) NSString *debugDescription; diff --git a/platform/ios/app/MBXState.m b/platform/ios/app/MBXState.m index 0365306637..ff5f3803dc 100644 --- a/platform/ios/app/MBXState.m +++ b/platform/ios/app/MBXState.m @@ -6,7 +6,6 @@ NSString *const MBXShowsUserLocation = @"MBXShowsUserLocation"; NSString *const MBXDebugMaskValue = @"MBXDebugMaskValue"; NSString *const MBXShowsZoomLevelOrnament = @"MBXShowsZoomLevelOrnament"; NSString *const MBXShowsTimeFrameGraph = @"MBXShowsFrameTimeGraph"; -NSString *const MBXDebugLoggingEnabled = @"MGLMapboxMetricsDebugLoggingEnabled"; NSString *const MBXShowsMapScale = @"MBXMapShowsScale"; NSString *const MBXMapShowsHeadingIndicator = @"MBXMapShowsHeadingIndicator"; NSString *const MBXMapFramerateMeasurementEnabled = @"MBXMapFramerateMeasurementEnabled"; @@ -26,7 +25,6 @@ NSString *const MBXReuseQueueStatsEnabled = @"MBXReuseQueueStatsEnabled"; [coder encodeObject:[NSNumber numberWithUnsignedInteger:_debugMask] forKey:MBXDebugMaskValue]; [coder encodeBool:_showsZoomLevelOrnament forKey:MBXShowsZoomLevelOrnament]; [coder encodeBool:_showsTimeFrameGraph forKey:MBXShowsTimeFrameGraph]; - [coder encodeBool:_debugLoggingEnabled forKey:MBXDebugLoggingEnabled]; [coder encodeBool:_showsMapScale forKey:MBXShowsMapScale]; [coder encodeBool:_showsUserHeadingIndicator forKey:MBXMapShowsHeadingIndicator]; [coder encodeBool:_framerateMeasurementEnabled forKey:MBXMapFramerateMeasurementEnabled]; @@ -41,7 +39,6 @@ NSString *const MBXReuseQueueStatsEnabled = @"MBXReuseQueueStatsEnabled"; NSNumber *decodedDebugMaskOptions = [decoder decodeObjectForKey:MBXDebugMaskValue]; BOOL decodedZoomLevelOrnament = [decoder decodeBoolForKey:MBXShowsZoomLevelOrnament]; BOOL decodedShowsTimeFrameGraph = [decoder decodeBoolForKey:MBXShowsTimeFrameGraph]; - BOOL decodedDebugLoggingEnabled = [decoder decodeBoolForKey:MBXDebugLoggingEnabled]; BOOL decodedShowsMapScale = [decoder decodeBoolForKey:MBXShowsMapScale]; BOOL decodedShowsUserHeadingIndicator = [decoder decodeBoolForKey:MBXMapShowsHeadingIndicator]; BOOL decodedFramerateMeasurementEnabled = [decoder decodeBoolForKey:MBXMapFramerateMeasurementEnabled]; @@ -53,7 +50,6 @@ NSString *const MBXReuseQueueStatsEnabled = @"MBXReuseQueueStatsEnabled"; _debugMask = decodedDebugMaskOptions.intValue; _showsZoomLevelOrnament = decodedZoomLevelOrnament; _showsTimeFrameGraph = decodedShowsTimeFrameGraph; - _debugLoggingEnabled = decodedDebugLoggingEnabled; _showsMapScale = decodedShowsMapScale; _showsUserHeadingIndicator = decodedShowsUserHeadingIndicator; _framerateMeasurementEnabled = decodedFramerateMeasurementEnabled; @@ -75,7 +71,6 @@ NSString *const MBXReuseQueueStatsEnabled = @"MBXReuseQueueStatsEnabled"; (unsigned long)self.debugMask, self.showsZoomLevelOrnament ? @"YES" : @"NO", self.showsTimeFrameGraph ? @"YES" : @"NO", - self.debugLoggingEnabled ? @"YES" : @"NO", self.showsMapScale ? @"YES" : @"NO", self.showsUserHeadingIndicator ? @"YES" : @"NO", self.framerateMeasurementEnabled ? @"YES" : @"NO", diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 2fb95e1b17..346a182a88 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -211,7 +211,6 @@ CLLocationCoordinate2D randomWorldCoordinate() { @property (nonatomic) BOOL shouldLimitCameraChanges; @property (nonatomic) BOOL randomWalk; @property (nonatomic) BOOL zoomLevelOrnamentEnabled; -@property (nonatomic) BOOL debugLoggingEnabled; @property (nonatomic) NSMutableArray<UIWindow *> *helperWindows; @property (nonatomic) NSMutableArray<UIView *> *contentInsetsOverlays; @@ -246,7 +245,6 @@ CLLocationCoordinate2D randomWorldCoordinate() { self.mapView.showsScale = YES; self.zoomLevelOrnamentEnabled = NO; self.frameTimeGraphEnabled = NO; - self.debugLoggingEnabled = YES; } else { // Revert to the previously saved state [self restoreMapState:nil]; @@ -441,14 +439,6 @@ CLLocationCoordinate2D randomWorldCoordinate() { @"Ornaments Placement", ]]; - if (self.currentState.debugLoggingEnabled) - { - [settingsTitles addObjectsFromArray:@[ - @"Print Telemetry Logfile", - @"Delete Telemetry Logfile", - ]]; - }; - break; default: NSAssert(NO, @"All settings sections should be implemented"); @@ -558,15 +548,12 @@ CLLocationCoordinate2D randomWorldCoordinate() { case MBXSettingsAnnotationSelectRandomOffscreenPointAnnotation: [self selectAnOffscreenPointAnnotation]; break; - case MBXSettingsAnnotationCenterSelectedAnnotation: [self centerSelectedAnnotation]; break; - case MBXSettingsAnnotationAddVisibleAreaPolyline: [self addVisibleAreaPolyline]; break; - default: NSAssert(NO, @"All annotations setting rows should be implemented"); break; @@ -667,13 +654,6 @@ CLLocationCoordinate2D randomWorldCoordinate() { case MBXSettingsMiscellaneousRandomTour: [self randomWorldTour]; break; - - case MBXSettingsMiscellaneousPrintLogFile: - [self printTelemetryLogFile]; - break; - case MBXSettingsMiscellaneousDeleteLogFile: - [self deleteTelemetryLogFile]; - break; case MBXSettingsMiscellaneousScrollView: { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; @@ -1734,37 +1714,6 @@ CLLocationCoordinate2D randomWorldCoordinate() { return backupImage; } -- (void)printTelemetryLogFile -{ - NSString *fileContents = [NSString stringWithContentsOfFile:[self telemetryDebugLogFilePath] encoding:NSUTF8StringEncoding error:nil]; - NSLog(@"%@", fileContents); -} - -- (void)deleteTelemetryLogFile -{ - NSString *filePath = [self telemetryDebugLogFilePath]; - if ([[NSFileManager defaultManager] isDeletableFileAtPath:filePath]) - { - NSError *error; - BOOL success = [[NSFileManager defaultManager] removeItemAtPath:filePath error:&error]; - if (success) { - NSLog(@"Deleted telemetry log."); - } else { - NSLog(@"Error deleting telemetry log: %@", error.localizedDescription); - } - } -} - -- (NSString *)telemetryDebugLogFilePath -{ - NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; - [dateFormatter setDateFormat:@"yyyy'-'MM'-'dd"]; - [dateFormatter setTimeZone:[NSTimeZone systemTimeZone]]; - NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingPathComponent:[NSString stringWithFormat:@"telemetry_log-%@.json", [dateFormatter stringFromDate:[NSDate date]]]]; - - return filePath; -} - #pragma mark - Random World Tour - (void)addAnnotations:(NSInteger)numAnnotations aroundCoordinate:(CLLocationCoordinate2D)coordinate radius:(CLLocationDistance)radius { @@ -2396,7 +2345,6 @@ CLLocationCoordinate2D randomWorldCoordinate() { self.currentState.showsZoomLevelOrnament = self.zoomLevelOrnamentEnabled; self.currentState.showsTimeFrameGraph = self.frameTimeGraphEnabled; self.currentState.debugMask = self.mapView.debugMask; - self.currentState.debugLoggingEnabled = self.debugLoggingEnabled; self.currentState.reuseQueueStatsEnabled = self.reuseQueueStatsEnabled; [[MBXStateManager sharedManager] saveState:self.currentState]; @@ -2413,7 +2361,6 @@ CLLocationCoordinate2D randomWorldCoordinate() { self.zoomLevelOrnamentEnabled = currentState.showsZoomLevelOrnament; self.frameTimeGraphEnabled = currentState.showsTimeFrameGraph; self.mapView.debugMask = currentState.debugMask; - self.debugLoggingEnabled = currentState.debugLoggingEnabled; self.reuseQueueStatsEnabled = currentState.reuseQueueStatsEnabled; self.currentState = currentState; |