summaryrefslogtreecommitdiff
path: root/platform/darwin/src/http_file_source.mm
diff options
context:
space:
mode:
authorFabian Guerra Soto <fabian.guerra@mapbox.com>2018-11-14 15:42:18 -0800
committerGitHub <noreply@github.com>2018-11-14 15:42:18 -0800
commitc8fbcfd322e1af4520f0bdc7e5945f6ffd3b4b73 (patch)
tree9158facaa7fc8b728a69f87f494a71fb659d9727 /platform/darwin/src/http_file_source.mm
parent86677b97c6d5e7db75358e9f5745dab4cec5d0e4 (diff)
downloadqtlocation-mapboxgl-c8fbcfd322e1af4520f0bdc7e5945f6ffd3b4b73.tar.gz
[ios, macos] Logging. (#13235)
* [ios, macos] Update the logging subsystem to platform agnostic. * [ios, macos] Add coordinate to string function. * [ios, macos] Add BOOL to string function. * [ios, macos] Add tracing logs. * [ios, macos] Add tracing logs to generated style classes. * [ios, macos] Split logging categories accordingly to MGLLoggingLevel. * [ios, macos] Log network requests. * [ios, macos] Migrate NSAssert to MGLAssert. * [ios, macos] Include MGLLoggingConfiguration to filesource-files.txt. * [ios, macos] Fix logger string specifier for the line parameter. * [ios, macos] Add logs to shapes classes. * [ios, macos] Add logs to offline classes. * [ios, macos] Add logs to annotation classes. * [ios, macos] Add logs to foundation classes. * [ios, macos] Fix snapshotter size logging. * [macos] Add logs to map view. * [ios, macos] Fix string from boolean prefix, add custom function for NSCAssert. * Log size test * [ios, macos] Add logging conditional compilation flag. * [ios, macos] Rename function NSStringFromMGLTransition to MGLStringFromMGLTransition. * [ios, macos] Remove verbose logging for release builds. * [ios, macos] Rename NSStringFromCLLocationCoordinate2D to MGLStringFromCLLocationCoordinate2D. * [ios, macos] Clean unnecesary blank lines in MGLLight.mm set methods. * [ios, macos] Fix logging grammar, format, function names. * [ios, macos] Remove compilation flag, rename flags.
Diffstat (limited to 'platform/darwin/src/http_file_source.mm')
-rw-r--r--platform/darwin/src/http_file_source.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/darwin/src/http_file_source.mm b/platform/darwin/src/http_file_source.mm
index 4a16ad82fb..9726f6064f 100644
--- a/platform/darwin/src/http_file_source.mm
+++ b/platform/darwin/src/http_file_source.mm
@@ -7,6 +7,7 @@
#include <mbgl/util/version.hpp>
#import <Foundation/Foundation.h>
+#import "MGLLoggingConfiguration_Private.h"
#include <mutex>
#include <chrono>
@@ -202,6 +203,7 @@ std::unique_ptr<AsyncRequest> HTTPFileSource::request(const Resource& resource,
@autoreleasepool {
NSURL* url = [NSURL URLWithString:@(resource.url.c_str())];
+ MGLLogDebug(@"Requesting URI: %@", url.relativePath);
if (impl->accountType == 0 &&
([url.host isEqualToString:@"mapbox.com"] || [url.host hasSuffix:@".mapbox.com"])) {
NSString* absoluteString = [url.absoluteString
@@ -231,6 +233,8 @@ std::unique_ptr<AsyncRequest> HTTPFileSource::request(const Resource& resource,
using Error = Response::Error;
if (error) {
+ MGLLogError(@"Requesting: %@ failed with error: %@", res.URL.relativePath, error);
+
if (data) {
response.data =
std::make_shared<std::string>((const char*)[data bytes], [data length]);
@@ -262,6 +266,7 @@ std::unique_ptr<AsyncRequest> HTTPFileSource::request(const Resource& resource,
}
} else if ([res isKindOfClass:[NSHTTPURLResponse class]]) {
const long responseCode = [(NSHTTPURLResponse *)res statusCode];
+ MGLLogDebug(@"Requesting %@ returned responseCode: %lu", res.URL.relativePath, responseCode);
NSDictionary *headers = [(NSHTTPURLResponse *)res allHeaderFields];
NSString *cache_control = [headers objectForKey:@"Cache-Control"];