From d33fc0b087aec47039698cdab0aa36f9692288b1 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Date: Wed, 14 Nov 2018 14:23:35 -0800 Subject: [ios, macos] Remove compilation flag, rename flags. --- platform/darwin/src/MGLLoggingConfiguration.h | 8 ++++---- platform/darwin/src/MGLLoggingConfiguration.m | 12 ++++++------ platform/darwin/src/MGLLoggingConfiguration_Private.h | 10 +++++----- platform/darwin/src/MGLOfflinePack.mm | 2 +- platform/ios/ios.xcodeproj/project.pbxproj | 2 +- platform/ios/src/MGLMapView.mm | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/platform/darwin/src/MGLLoggingConfiguration.h b/platform/darwin/src/MGLLoggingConfiguration.h index fd3bf9d01a..6782dc60a7 100644 --- a/platform/darwin/src/MGLLoggingConfiguration.h +++ b/platform/darwin/src/MGLLoggingConfiguration.h @@ -2,10 +2,10 @@ #import "MGLFoundation.h" -#ifndef MGL_DISABLE_LOGGING - #ifndef MGL_ENABLE_DEBUG_LOGGING +#ifndef MGL_LOGGING_DISABLED + #ifndef MGL_LOGGING_ENABLE_DEBUG #ifdef DEBUG - #define MGL_ENABLE_DEBUG_LOGGING 1 + #define MGL_LOGGING_ENABLE_DEBUG 1 #endif #endif @@ -24,7 +24,7 @@ typedef NS_ENUM(NSInteger, MGLLoggingLevel) { but is not essential. */ MGLLoggingLevelInfo, -#if MGL_ENABLE_DEBUG_LOGGING +#if MGL_LOGGING_ENABLE_DEBUG /** Debug-level messages contain information that may be helpful for troubleshooting specific problems. diff --git a/platform/darwin/src/MGLLoggingConfiguration.m b/platform/darwin/src/MGLLoggingConfiguration.m index fc2d231d4a..fb760b7392 100644 --- a/platform/darwin/src/MGLLoggingConfiguration.m +++ b/platform/darwin/src/MGLLoggingConfiguration.m @@ -1,6 +1,6 @@ #import "MGLLoggingConfiguration_Private.h" -#ifndef MGL_DISABLE_LOGGING +#ifndef MGL_LOGGING_DISABLED #if __has_builtin(__builtin_os_log_format) #import #endif @@ -44,21 +44,21 @@ if (@available(iOS 10.0, macOS 10.12.0, *)) { static dispatch_once_t once; static os_log_t info_log; -#if MGL_ENABLE_DEBUG_LOGGING +#if MGL_LOGGING_ENABLE_DEBUG static os_log_t debug_log; #endif static os_log_t error_log; static os_log_t fault_log; static os_log_type_t log_types[] = { OS_LOG_TYPE_DEFAULT, OS_LOG_TYPE_INFO, -#if MGL_ENABLE_DEBUG_LOGGING +#if MGL_LOGGING_ENABLE_DEBUG OS_LOG_TYPE_DEBUG, #endif OS_LOG_TYPE_ERROR, OS_LOG_TYPE_FAULT }; dispatch_once(&once, ^ { info_log = os_log_create("com.mapbox.maps", "INFO"); -#if MGL_ENABLE_DEBUG_LOGGING +#if MGL_LOGGING_ENABLE_DEBUG debug_log = os_log_create("com.mapbox.maps", "DEBUG"); #endif error_log = os_log_create("com.mapbox.maps", "ERROR"); @@ -70,7 +70,7 @@ case MGLLoggingLevelInfo: mapbox_log = info_log; break; -#if MGL_ENABLE_DEBUG_LOGGING +#if MGL_LOGGING_ENABLE_DEBUG case MGLLoggingLevelDebug: mapbox_log = debug_log; break; @@ -94,7 +94,7 @@ case MGLLoggingLevelInfo: category = @"INFO"; break; -#if MGL_ENABLE_DEBUG_LOGGING +#if MGL_LOGGING_ENABLE_DEBUG case MGLLoggingLevelDebug: category = @"DEBUG"; break; diff --git a/platform/darwin/src/MGLLoggingConfiguration_Private.h b/platform/darwin/src/MGLLoggingConfiguration_Private.h index 2f4c9d0142..34e999ca72 100644 --- a/platform/darwin/src/MGLLoggingConfiguration_Private.h +++ b/platform/darwin/src/MGLLoggingConfiguration_Private.h @@ -4,16 +4,16 @@ NS_INLINE NSString *MGLStringFromBOOL(BOOL value) { return value ? @"YES" : @"NO"; } -#ifdef MGL_DISABLE_LOGGING +#ifdef MGL_LOGGING_DISABLED #define MGLLogInfo(...) #define MGLLogDebug(...) -#define MGLLogError(message, ...) -#define MGLLogFault(message, ...) +#define MGLLogError(...) +#define MGLLogFault(...) #else -#if MGL_ENABLE_DEBUG_LOGGING +#if MGL_LOGGING_ENABLE_DEBUG #define MGLLogDebug(message, ...) MGLLogWithType(MGLLoggingLevelDebug, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__) #else #define MGLLogDebug(...) @@ -41,7 +41,7 @@ NS_INLINE NSString *MGLStringFromBOOL(BOOL value) { }) -#ifndef MGL_DISABLE_LOGGING +#ifndef MGL_LOGGING_DISABLED #define MGLLogWithType(type, function, line, message, ...) \ { \ diff --git a/platform/darwin/src/MGLOfflinePack.mm b/platform/darwin/src/MGLOfflinePack.mm index aa317d33e8..a8f807374c 100644 --- a/platform/darwin/src/MGLOfflinePack.mm +++ b/platform/darwin/src/MGLOfflinePack.mm @@ -215,7 +215,7 @@ private: - (void)didReceiveError:(NSError *)error { MGLLogError(@"Error: %@", error.localizedDescription); - MGLLogInfo(@"About notifying pack error."); + MGLLogInfo(@"Notifying about pack error."); NSDictionary *userInfo = @{ MGLOfflinePackUserInfoKeyError: error }; NSNotificationCenter *noteCenter = [NSNotificationCenter defaultCenter]; diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 25dd96ecde..78acfb46ec 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -3620,7 +3620,7 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = "MGL_DISABLE_LOGGING=1"; + GCC_PREPROCESSOR_DEFINITIONS = ""; "GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = ""; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 18b333d9ab..4880a63cb9 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -688,6 +688,7 @@ public: - (void)dealloc { + MGLLogInfo(@"Deallocating MGLMapView."); [_reachability stopNotifier]; [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]; @@ -735,7 +736,6 @@ public: [_locationManager stopUpdatingLocation]; [_locationManager stopUpdatingHeading]; _locationManager.delegate = nil; - MGLLogInfo(@"Deallocating MGLMapView."); } - (void)setDelegate:(nullable id)delegate -- cgit v1.2.1