diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-03-12 15:39:07 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-03-12 15:39:07 -0700 |
commit | ba933b3f452156bf0a4ce63a0de89c9bcb861387 (patch) | |
tree | be7aea599e6f1d7a84f28965508ba6c8527547a9 /platform | |
parent | 4c7939b96eddb53f1700edfaea7abe1fa5b0e886 (diff) | |
parent | 124b49562ddfe951ad82243b56a859a46a58bd57 (diff) | |
download | qtlocation-mapboxgl-ba933b3f452156bf0a4ce63a0de89c9bcb861387.tar.gz |
Merge pull request #984 from mapbox/log_stderr_printf
Get rid of printf and cout by using Log::*
Diffstat (limited to 'platform')
-rw-r--r-- | platform/default/glfw_view.cpp | 6 | ||||
-rw-r--r-- | platform/default/headless_view.cpp | 2 | ||||
-rw-r--r-- | platform/default/image.cpp | 8 | ||||
-rw-r--r-- | platform/default/png_reader.cpp | 4 | ||||
-rw-r--r-- | platform/ios/MGLMapView.mm | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index 2d0da355b2..601ae0ec2d 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -25,7 +25,7 @@ void GLFWView::initialize(mbgl::Map *map_) { glfwSetErrorCallback(glfwError); if (!glfwInit()) { - fprintf(stderr, "Failed to initialize glfw\n"); + mbgl::Log::Error(mbgl::Event::OpenGL, "failed to initialize glfw"); exit(1); } @@ -54,7 +54,7 @@ void GLFWView::initialize(mbgl::Map *map_) { window = glfwCreateWindow(1024, 768, "Mapbox GL", monitor, NULL); if (!window) { glfwTerminate(); - fprintf(stderr, "Failed to initialize window\n"); + mbgl::Log::Error(mbgl::Event::OpenGL, "failed to initialize window"); exit(1); } @@ -312,7 +312,7 @@ void GLFWView::fps() { double currentTime = glfwGetTime(); if (currentTime - timeElapsed >= 1) { - fprintf(stderr, "FPS: %4.2f\n", frames / (currentTime - timeElapsed)); + mbgl::Log::Info(mbgl::Event::OpenGL, "FPS: %4.2f", frames / (currentTime - timeElapsed)); timeElapsed = currentTime; frames = 0; } diff --git a/platform/default/headless_view.cpp b/platform/default/headless_view.cpp index 7509c48eec..df85ee714c 100644 --- a/platform/default/headless_view.cpp +++ b/platform/default/headless_view.cpp @@ -125,7 +125,7 @@ void HeadlessView::createContext() { glContext = glXCreateNewContext(xDisplay, fbConfigs[0], GLX_RGBA_TYPE, None, True); if (glContext) { if (!glXIsDirect(xDisplay, glContext)) { - mbgl::Log::Error(mbgl::Event::OpenGL, "Failed to create direct OpenGL Legacy context"); + Log::Error(Event::OpenGL, "failed to create direct OpenGL Legacy context"); glXDestroyContext(xDisplay, glContext); glContext = 0; } diff --git a/platform/default/image.cpp b/platform/default/image.cpp index 311aa2ed72..1a10d78ffa 100644 --- a/platform/default/image.cpp +++ b/platform/default/image.cpp @@ -32,14 +32,14 @@ std::string compress_png(int width, int height, void *rgba) { png_voidp error_ptr = 0; png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, error_ptr, NULL, NULL); if (!png_ptr) { - Log::Error(Event::Image, "Couldn't create png_ptr"); + Log::Error(Event::Image, "couldn't create png_ptr"); return ""; } png_infop info_ptr = png_create_info_struct(png_ptr); if (!png_ptr) { png_destroy_write_struct(&png_ptr, (png_infopp)0); - Log::Error(Event::Image, "Couldn't create info_ptr"); + Log::Error(Event::Image, "couldn't create info_ptr"); return ""; } @@ -87,7 +87,7 @@ Image::Image(std::string const& data) } catch (ImageReaderException const& ex) { - fprintf(stderr, "Image: %s\n", ex.what()); + Log::Error(Event::Image, ex.what()); img.reset(); width = 0; height = 0; @@ -95,7 +95,7 @@ Image::Image(std::string const& data) } catch (...) // catch the rest { - fprintf(stderr, "Image: exception in constructor"); + Log::Error(Event::Image, "exception in constructor"); img.reset(); width = 0; height = 0; diff --git a/platform/default/png_reader.cpp b/platform/default/png_reader.cpp index cf96ca2363..91fe007bcf 100644 --- a/platform/default/png_reader.cpp +++ b/platform/default/png_reader.cpp @@ -1,4 +1,5 @@ #include <mbgl/platform/default/png_reader.hpp> +#include <mbgl/platform/log.hpp> #include <iostream> extern "C" { @@ -23,8 +24,7 @@ void user_error_fn(png_structp /*png_ptr*/, png_const_charp error_msg) void user_warning_fn(png_structp /*png_ptr*/, png_const_charp warning_msg) { - fprintf(stderr, "ImageReader (PNG): %s\n", warning_msg); - + Log::Warning(Event::Image, "ImageReader (PNG): %s", warning_msg); } template <typename T> diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index d9390ef178..ead1e0a068 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -187,7 +187,7 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr; if ( ! _context) { - mbgl::Log::Error(mbgl::Event::Setup, "Failed to create OpenGL ES context"); + mbgl::Log::Error(mbgl::Event::Setup, "failed to create OpenGL ES context"); return NO; } |