diff options
author | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-11-06 16:00:31 -0800 |
---|---|---|
committer | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-11-13 15:58:34 -0800 |
commit | fb8a0db1df20a94fa2ed13ad3a7aaebffbd98db3 (patch) | |
tree | 171946f26d38e174ec75fb61e2a05dbb0f879d79 | |
parent | 8af3efd79fb6b83df5f08be46268ecb6374ce69c (diff) | |
download | qtlocation-mapboxgl-fb8a0db1df20a94fa2ed13ad3a7aaebffbd98db3.tar.gz |
[ios, macos] Add logs to foundation classes.
-rw-r--r-- | platform/darwin/src/MGLMapCamera.mm | 4 | ||||
-rw-r--r-- | platform/darwin/src/MGLMapSnapshotter.mm | 5 | ||||
-rw-r--r-- | platform/darwin/src/MGLStyle.mm | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/platform/darwin/src/MGLMapCamera.mm b/platform/darwin/src/MGLMapCamera.mm index 62f7931641..c124c8f463 100644 --- a/platform/darwin/src/MGLMapCamera.mm +++ b/platform/darwin/src/MGLMapCamera.mm @@ -1,5 +1,6 @@ #import "MGLMapCamera.h" #import "MGLGeometry_Private.h" +#import "MGLLoggingConfiguration_Private.h" #import <CoreLocation/CoreLocation.h> @@ -91,6 +92,7 @@ BOOL MGLEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy) pitch:(CGFloat)pitch heading:(CLLocationDirection)heading { + MGLLogDebug(@"Initializing withCenterCoordinate: %@ altitude: %.0fm pitch: %f° heading: %f°", NSStringFromCLLocationCoordinate2D(centerCoordinate), altitude, pitch, heading); if (self = [super init]) { _centerCoordinate = centerCoordinate; @@ -103,6 +105,7 @@ BOOL MGLEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy) - (nullable instancetype)initWithCoder:(NSCoder *)coder { + MGLLogInfo(@"Initialiazing with coder."); if (self = [super init]) { _centerCoordinate = CLLocationCoordinate2DMake([coder decodeDoubleForKey:@"centerLatitude"], @@ -141,6 +144,7 @@ BOOL MGLEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy) } - (void)setViewingDistance:(CLLocationDistance)distance { + MGLLogDebug(@"Setting viewingDistance: %f", distance); CLLocationDirection eyeAngle = 90 - self.pitch; self.altitude = distance * sin(MGLRadiansFromDegrees(eyeAngle)); } diff --git a/platform/darwin/src/MGLMapSnapshotter.mm b/platform/darwin/src/MGLMapSnapshotter.mm index 124ec34fbe..06a2e55618 100644 --- a/platform/darwin/src/MGLMapSnapshotter.mm +++ b/platform/darwin/src/MGLMapSnapshotter.mm @@ -32,6 +32,7 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64; - (instancetype _Nonnull)initWithStyleURL:(nullable NSURL *)styleURL camera:(MGLMapCamera *)camera size:(CGSize) size { + MGLLogDebug(@"Initializing withStyleURL: %@ camera: %@ size: %@", styleURL, camera, NSStringFromCGSize(size)); self = [super init]; if (self) { if ( !styleURL) @@ -135,6 +136,7 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64; - (instancetype)initWithOptions:(MGLMapSnapshotOptions *)options { + MGLLogDebug(@"Initializing withOptions: %@", options); self = [super init]; if (self) { [self setOptions:options]; @@ -144,6 +146,7 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64; - (void)startWithCompletionHandler:(MGLMapSnapshotCompletionHandler)completion { + MGLLogDebug(@"Starting withCompletionHandler: %@", completion); [self startWithQueue:dispatch_get_main_queue() completionHandler:completion]; } @@ -501,6 +504,7 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64; - (void)cancel { + MGLLogInfo(@"Cancelling snapshotter."); self.cancelled = YES; if (_snapshotCallback) { @@ -530,6 +534,7 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64; - (void)setOptions:(MGLMapSnapshotOptions *)options { + MGLLogDebug(@"Setting options: %@", options); _options = options; mbgl::DefaultFileSource *mbglFileSource = [MGLOfflineStorage sharedOfflineStorage].mbglFileSource; _mbglThreadPool = mbgl::sharedThreadPool(); diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index 27b8c210ac..c023ed80f4 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -129,8 +129,8 @@ static_assert(6 == mbgl::util::default_styles::numOrderedStyles, #pragma mark - - (instancetype)initWithRawStyle:(mbgl::style::Style *)rawStyle mapView:(MGLMapView *)mapView { + MGLLogInfo(@"Initializing %@ with mapView: %@", NSStringFromClass([self class]), mapView); if (self = [super init]) { - MGLLogInfo(@"Initializing %@", NSStringFromClass([self class])); _mapView = mapView; _rawStyle = rawStyle; _openGLLayers = [NSMutableDictionary dictionary]; |