diff options
author | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-11-06 12:59:08 -0800 |
---|---|---|
committer | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-11-13 15:58:34 -0800 |
commit | 767b31328f481f1d084d55b47530bb471148c90d (patch) | |
tree | c45b962d739ce147ca9d08a6e98a3ce96f591849 | |
parent | 9c3f2a5dcaea2aa15f85c70f1d66732bb7e6ab53 (diff) | |
download | qtlocation-mapboxgl-767b31328f481f1d084d55b47530bb471148c90d.tar.gz |
[ios, macos] Add logs to shapes classes.
-rw-r--r-- | platform/darwin/src/MGLFeature.mm | 7 | ||||
-rw-r--r-- | platform/darwin/src/MGLMultiPoint.mm | 8 | ||||
-rw-r--r-- | platform/darwin/src/MGLPointAnnotation.mm | 2 | ||||
-rw-r--r-- | platform/darwin/src/MGLPointCollection.mm | 2 | ||||
-rw-r--r-- | platform/darwin/src/MGLPolygon.mm | 5 | ||||
-rw-r--r-- | platform/darwin/src/MGLPolyline.mm | 2 | ||||
-rw-r--r-- | platform/darwin/src/MGLShapeCollection.mm | 3 |
7 files changed, 29 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLFeature.mm b/platform/darwin/src/MGLFeature.mm index 57760be73e..2298960025 100644 --- a/platform/darwin/src/MGLFeature.mm +++ b/platform/darwin/src/MGLFeature.mm @@ -32,6 +32,7 @@ MGL_DEFINE_FEATURE_ENCODE(); MGL_DEFINE_FEATURE_IS_EQUAL(); - (id)attributeForKey:(NSString *)key { + MGLLogDebug(@"Retrieving attributeForKey: %@", key); return self.attributes[key]; } @@ -66,6 +67,7 @@ MGL_DEFINE_FEATURE_ENCODE(); MGL_DEFINE_FEATURE_IS_EQUAL(); - (id)attributeForKey:(NSString *)key { + MGLLogDebug(@"Retrieving attributeForKey: %@", key); return self.attributes[key]; } @@ -101,6 +103,7 @@ MGL_DEFINE_FEATURE_ENCODE(); MGL_DEFINE_FEATURE_IS_EQUAL(); - (id)attributeForKey:(NSString *)key { + MGLLogDebug(@"Retrieving attributeForKey: %@", key); return self.attributes[key]; } @@ -137,6 +140,7 @@ MGL_DEFINE_FEATURE_ENCODE(); MGL_DEFINE_FEATURE_IS_EQUAL(); - (id)attributeForKey:(NSString *)key { + MGLLogDebug(@"Retrieving attributeForKey: %@", key); return self.attributes[key]; } @@ -173,6 +177,7 @@ MGL_DEFINE_FEATURE_ENCODE(); MGL_DEFINE_FEATURE_IS_EQUAL(); - (id)attributeForKey:(NSString *)key { + MGLLogDebug(@"Retrieving attributeForKey: %@", key); return self.attributes[key]; } @@ -199,6 +204,7 @@ MGL_DEFINE_FEATURE_ENCODE(); MGL_DEFINE_FEATURE_IS_EQUAL(); - (id)attributeForKey:(NSString *)key { + MGLLogDebug(@"Retrieving attributeForKey: %@", key); return self.attributes[key]; } @@ -235,6 +241,7 @@ MGL_DEFINE_FEATURE_ENCODE(); MGL_DEFINE_FEATURE_IS_EQUAL(); - (id)attributeForKey:(NSString *)key { + MGLLogDebug(@"Retrieving attributeForKey: %@", key); return self.attributes[key]; } diff --git a/platform/darwin/src/MGLMultiPoint.mm b/platform/darwin/src/MGLMultiPoint.mm index 13170d0696..19aacaea43 100644 --- a/platform/darwin/src/MGLMultiPoint.mm +++ b/platform/darwin/src/MGLMultiPoint.mm @@ -13,6 +13,7 @@ - (instancetype)initWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count { + MGLLogDebug(@"Initializing with %lu coordinates.", (unsigned long) count); self = [super init]; if (self) @@ -29,6 +30,7 @@ - (instancetype)initWithCoder:(NSCoder *)decoder { + MGLLogInfo(@"Initializing with coder."); if (self = [super initWithCoder:decoder]) { _coordinates = [decoder mgl_decodeLocationCoordinates2DForKey:@"coordinates"]; } @@ -94,6 +96,7 @@ } - (void)setCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count { + MGLLogDebug(@"Setting: %lu coordinates.", (unsigned long)count); if (!count) { [NSException raise:NSInvalidArgumentException format:@"A multipoint must have at least one vertex."]; @@ -106,6 +109,7 @@ } - (void)insertCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count atIndex:(NSUInteger)index { + MGLLogDebug(@"Inserting %lu coordinates at index %lu.", (unsigned long)count, (unsigned long)index); if (!count) { return; } @@ -124,15 +128,18 @@ - (void)appendCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count { + MGLLogDebug(@"Appending %lu coordinates.", (unsigned long)count); [self insertCoordinates:coords count:count atIndex:_coordinates.size()]; } - (void)replaceCoordinatesInRange:(NSRange)range withCoordinates:(const CLLocationCoordinate2D *)coords { + MGLLogDebug(@"Replacing coordinates in range: %@", NSStringFromRange(range)); [self replaceCoordinatesInRange:range withCoordinates:coords count:range.length]; } - (void)replaceCoordinatesInRange:(NSRange)range withCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count { + MGLLogDebug(@"Replacing %lu coordinates in range %@.", (unsigned long)count, NSStringFromRange(range)); if (!count && !range.length) { return; } @@ -155,6 +162,7 @@ } - (void)removeCoordinatesInRange:(NSRange)range { + MGLLogDebug(@"Removing coordinatesInRange: %@", NSStringFromRange(range)); CLLocationCoordinate2D coords; [self replaceCoordinatesInRange:range withCoordinates:&coords count:0]; } diff --git a/platform/darwin/src/MGLPointAnnotation.mm b/platform/darwin/src/MGLPointAnnotation.mm index 5fd3e25991..233bef0a0f 100644 --- a/platform/darwin/src/MGLPointAnnotation.mm +++ b/platform/darwin/src/MGLPointAnnotation.mm @@ -2,6 +2,7 @@ #import "MGLShape_Private.h" #import "NSCoder+MGLAdditions.h" +#import "MGLLoggingConfiguration_Private.h" #import <mbgl/util/geometry.hpp> @@ -17,6 +18,7 @@ - (instancetype)initWithCoder:(NSCoder *)coder { + MGLLogInfo(@"Initializing with coder."); if (self = [super initWithCoder:coder]) { self.coordinate = [coder decodeMGLCoordinateForKey:@"coordinate"]; } diff --git a/platform/darwin/src/MGLPointCollection.mm b/platform/darwin/src/MGLPointCollection.mm index 2856d1fe70..f4f91f0162 100644 --- a/platform/darwin/src/MGLPointCollection.mm +++ b/platform/darwin/src/MGLPointCollection.mm @@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count { + MGLLogDebug(@"Initializing with %lu coordinates.", (unsigned long)count); self = [super init]; if (self) { @@ -30,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable instancetype)initWithCoder:(NSCoder *)decoder { + MGLLogInfo(@"Initializing with coder.O"); if (self = [super initWithCoder:decoder]) { NSArray *coordinates = [decoder decodeObjectOfClass:[NSArray class] forKey:@"coordinates"]; _coordinates = [coordinates mgl_coordinates]; diff --git a/platform/darwin/src/MGLPolygon.mm b/platform/darwin/src/MGLPolygon.mm index b80504707b..6304408f7a 100644 --- a/platform/darwin/src/MGLPolygon.mm +++ b/platform/darwin/src/MGLPolygon.mm @@ -2,6 +2,7 @@ #import "MGLMultiPoint_Private.h" #import "MGLGeometry_Private.h" +#import "MGLLoggingConfiguration_Private.h" #import "MGLFeature.h" @@ -21,6 +22,7 @@ } - (instancetype)initWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count interiorPolygons:(NSArray<MGLPolygon *> *)interiorPolygons { + MGLLogDebug(@"Initializing with %lu coordinates and %lu interiorPolygons.", (unsigned long)count, (unsigned long)interiorPolygons); if (self = [super initWithCoordinates:coords count:count]) { if (interiorPolygons.count) { _interiorPolygons = interiorPolygons; @@ -30,6 +32,7 @@ } - (instancetype)initWithCoder:(NSCoder *)decoder { + MGLLogInfo(@"Initializng with coder."); self = [super initWithCoder:decoder]; if (self) { _interiorPolygons = [decoder decodeObjectOfClass:[NSArray class] forKey:@"interiorPolygons"]; @@ -143,6 +146,7 @@ } - (instancetype)initWithPolygons:(NSArray<MGLPolygon *> *)polygons { + MGLLogDebug(@"Initializing with %lu polygons.", (unsigned long)polygons.count); if (self = [super init]) { _polygons = polygons; @@ -157,6 +161,7 @@ } - (instancetype)initWithCoder:(NSCoder *)decoder { + MGLLogInfo(@"Initializing with coder."); if (self = [super initWithCoder:decoder]) { _polygons = [decoder decodeObjectOfClass:[NSArray class] forKey:@"polygons"]; } diff --git a/platform/darwin/src/MGLPolyline.mm b/platform/darwin/src/MGLPolyline.mm index 65030dd1d4..25c540b527 100644 --- a/platform/darwin/src/MGLPolyline.mm +++ b/platform/darwin/src/MGLPolyline.mm @@ -139,6 +139,7 @@ } - (instancetype)initWithPolylines:(NSArray<MGLPolyline *> *)polylines { + MGLLogDebug(@"Initializing with %lu polylines.", (unsigned long)polylines.count); if (self = [super init]) { _polylines = polylines; @@ -153,6 +154,7 @@ } - (instancetype)initWithCoder:(NSCoder *)decoder { + MGLLogInfo(@"Initializing with coder."); if (self = [super initWithCoder:decoder]) { _polylines = [decoder decodeObjectOfClass:[NSArray class] forKey:@"polylines"]; } diff --git a/platform/darwin/src/MGLShapeCollection.mm b/platform/darwin/src/MGLShapeCollection.mm index 5db1ee335c..5a0ef03340 100644 --- a/platform/darwin/src/MGLShapeCollection.mm +++ b/platform/darwin/src/MGLShapeCollection.mm @@ -2,6 +2,7 @@ #import "MGLShape_Private.h" #import "MGLFeature.h" +#import "MGLLoggingConfiguration_Private.h" #import <mbgl/style/conversion/geojson.hpp> @@ -12,6 +13,7 @@ } - (instancetype)initWithShapes:(NSArray<MGLShape *> *)shapes { + MGLLogDebug(@"Initializing with %lu shapes.", (unsigned long)shapes.count); if (self = [super init]) { _shapes = shapes.copy; } @@ -19,6 +21,7 @@ } - (instancetype)initWithCoder:(NSCoder *)decoder { + MGLLogInfo(@"Initializing with coder."); if (self = [super initWithCoder:decoder]) { _shapes = [decoder decodeObjectOfClass:[NSArray class] forKey:@"shapes"]; } |