diff options
Diffstat (limited to 'platform/darwin/src/MGLOfflineStorage.mm')
-rw-r--r-- | platform/darwin/src/MGLOfflineStorage.mm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/platform/darwin/src/MGLOfflineStorage.mm b/platform/darwin/src/MGLOfflineStorage.mm index 5e50e83274..24aaeb546c 100644 --- a/platform/darwin/src/MGLOfflineStorage.mm +++ b/platform/darwin/src/MGLOfflineStorage.mm @@ -12,6 +12,7 @@ #import "NSValue+MGLAdditions.h" #import "NSDate+MGLAdditions.h" #import "NSData+MGLAdditions.h" +#import "MGLLoggingConfiguration_Private.h" #if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR #import "MMEConstants.h" @@ -87,6 +88,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio #endif - (void)setDelegate:(id<MGLOfflineStorageDelegate>)newValue { + MGLLogDebug(@"Setting delegate: %@", newValue); _delegate = newValue; if ([self.delegate respondsToSelector:@selector(offlineStorage:URLForResourceOfKind:withURL:)]) { _mbglResourceTransform = std::make_unique<mbgl::Actor<mbgl::ResourceTransform>>(*mbgl::Scheduler::GetCurrent(), [offlineStorage = self](auto kind_, const std::string&& url_) -> std::string { @@ -276,6 +278,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio #pragma mark Offline merge methods - (void)addContentsOfFile:(NSString *)filePath withCompletionHandler:(MGLBatchedOfflinePackAdditionCompletionHandler)completion { + MGLLogDebug(@"Adding contentsOfFile: %@ completionHandler: %@", filePath, completion); NSURL *fileURL = [NSURL fileURLWithPath:filePath]; [self addContentsOfURL:fileURL withCompletionHandler:completion]; @@ -283,7 +286,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio } - (void)addContentsOfURL:(NSURL *)fileURL withCompletionHandler:(MGLBatchedOfflinePackAdditionCompletionHandler)completion { - + MGLLogDebug(@"Adding contentsOfURL: %@ completionHandler: %@", fileURL, completion); NSFileManager *fileManager = [NSFileManager defaultManager]; if (!fileURL.isFileURL) { @@ -359,6 +362,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio #pragma mark Pack management methods - (void)addPackForRegion:(id <MGLOfflineRegion>)region withContext:(NSData *)context completionHandler:(MGLOfflinePackAdditionCompletionHandler)completion { + MGLLogDebug(@"Adding packForRegion: %@ contextLength: %lu completionHandler: %@", region, (unsigned long)context.length, completion); __weak MGLOfflineStorage *weakSelf = self; [self _addPackForRegion:region withContext:context completionHandler:^(MGLOfflinePack * _Nullable pack, NSError * _Nullable error) { pack.state = MGLOfflinePackStateInactive; @@ -409,6 +413,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio } - (void)removePack:(MGLOfflinePack *)pack withCompletionHandler:(MGLOfflinePackRemovalCompletionHandler)completion { + MGLLogDebug(@"Removing pack: %@ completionHandler: %@", pack, completion); [[self mutableArrayValueForKey:@"packs"] removeObject:pack]; [self _removePack:pack withCompletionHandler:^(NSError * _Nullable error) { if (completion) { @@ -441,6 +446,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio } - (void)reloadPacks { + MGLLogInfo(@"Reloading packs."); [self getPacksWithCompletionHandler:^(NSArray<MGLOfflinePack *> *packs, __unused NSError * _Nullable error) { for (MGLOfflinePack *pack in self.packs) { [pack invalidate]; @@ -474,6 +480,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio } - (void)setMaximumAllowedMapboxTiles:(uint64_t)maximumCount { + MGLLogDebug(@"Setting maximumAllowedMapboxTiles: %lu", (unsigned long)maximumCount); _mbglFileSource->setOfflineMapboxTileCountLimit(maximumCount); } |