summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Guerra <fabian.guerra@mapbox.com>2018-11-14 14:23:35 -0800
committerFabian Guerra <fabian.guerra@mapbox.com>2018-11-14 14:23:44 -0800
commitd33fc0b087aec47039698cdab0aa36f9692288b1 (patch)
tree2e66daf2c21f748472f12331bb9a95dca772f6f4
parent772344357c5bf68a02448289395904cdd15cbc4e (diff)
downloadqtlocation-mapboxgl-upstream/fabian-sdk-logging.tar.gz
[ios, macos] Remove compilation flag, rename flags.upstream/fabian-sdk-logging
-rw-r--r--platform/darwin/src/MGLLoggingConfiguration.h8
-rw-r--r--platform/darwin/src/MGLLoggingConfiguration.m12
-rw-r--r--platform/darwin/src/MGLLoggingConfiguration_Private.h10
-rw-r--r--platform/darwin/src/MGLOfflinePack.mm2
-rw-r--r--platform/ios/ios.xcodeproj/project.pbxproj2
-rw-r--r--platform/ios/src/MGLMapView.mm2
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 <os/log.h>
#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<MGLMapViewDelegate>)delegate