From 7ffe4a7858bc5d071b87612bdaa19d8eaf29045c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Fri, 11 Jul 2014 14:34:17 -0700 Subject: add nslog and stderr log backends --- macosx/llmr-app.gyp | 2 ++ macosx/main.mm | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'macosx') 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 int main() { + llmr::Log::Set(); + 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 -- cgit v1.2.1