summaryrefslogtreecommitdiff
path: root/macosx
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-07-11 14:34:17 -0700
committerKonstantin Käfer <mail@kkaefer.com>2014-07-11 14:34:17 -0700
commit7ffe4a7858bc5d071b87612bdaa19d8eaf29045c (patch)
tree701750687b9331dcd290d9831ad8b62be9a97cae /macosx
parentf3c55eba9da59042a96e683f841060674519520b (diff)
downloadqtlocation-mapboxgl-7ffe4a7858bc5d071b87612bdaa19d8eaf29045c.tar.gz
add nslog and stderr log backends
Diffstat (limited to 'macosx')
-rw-r--r--macosx/llmr-app.gyp2
-rw-r--r--macosx/main.mm7
2 files changed, 6 insertions, 3 deletions
diff --git a/macosx/llmr-app.gyp b/macosx/llmr-app.gyp
index 02319da94b..139cb744c5 100644
--- a/macosx/llmr-app.gyp
+++ b/macosx/llmr-app.gyp
@@ -16,6 +16,8 @@
'../common/glfw_view.cpp',
'../common/foundation_request.h',
'../common/foundation_request.mm',
+ '../common/nslog_log.hpp',
+ '../common/nslog_log.mm',
],
'product_extension': 'app',
'mac_bundle': 1,
diff --git a/macosx/main.mm b/macosx/main.mm
index 3b01df04e6..f72476cde2 100644
--- a/macosx/main.mm
+++ b/macosx/main.mm
@@ -1,9 +1,12 @@
#include "../common/settings_nsuserdefaults.hpp"
#include "../common/glfw_view.hpp"
+#include "../common/nslog_log.hpp"
#import <Foundation/Foundation.h>
int main() {
+ llmr::Log::Set<llmr::NSLogBackend>();
+
GLFWView view;
llmr::Map map(view);
@@ -16,7 +19,7 @@ int main() {
// Set access token if present
const char *token = getenv("MAPBOX_ACCESS_TOKEN");
if (token == nullptr) {
- fprintf(stderr, "[WARNING] no access token set. mapbox.com tiles won't work.\n");
+ llmr::Log::Warning(llmr::Event::Setup, "no access token set. mapbox.com tiles won't work.");
} else {
map.setAccessToken(std::string(token));
}
@@ -28,8 +31,6 @@ int main() {
error:nil];
map.setStyleJSON((std::string)[json cStringUsingEncoding:[NSString defaultCStringEncoding]]);
- // fprintf(stderr, "lon: %f, lat: %f, zoom: %f, angle: %f, debug: %d\n", settings.l)
-
int ret = view.run();
// Save settings