[ios] Remove obsolete iosapp telemetry debug logging
This has been superceded by features in the standalone events library.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user