summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2017-11-23 14:48:08 -0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2017-11-24 01:30:39 -0200
commitcf3357ea4517e74ba3a63434c330a1506064b130 (patch)
tree604cf5cea4ca424c4f2eb68258890340bbd47f92
parent43d96cd1b969f328af60ed0d1e0775de3a6f8b13 (diff)
downloadqtlocation-mapboxgl-cf3357ea4517e74ba3a63434c330a1506064b130.tar.gz
[qt] Use qWarning() for logging
This is the Qt default and it is thread-safe.
-rw-r--r--platform/qt/qt.cmake4
-rwxr-xr-xplatform/qt/src/qt_logging.cpp12
2 files changed, 13 insertions, 3 deletions
diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake
index f832dd593c..1bcb869fc9 100644
--- a/platform/qt/qt.cmake
+++ b/platform/qt/qt.cmake
@@ -21,9 +21,6 @@ set(MBGL_QT_CORE_FILES
PRIVATE platform/default/mbgl/gl/headless_display.hpp
PRIVATE platform/qt/src/headless_backend_qt.cpp
- # Misc
- PRIVATE platform/default/logging_stderr.cpp
-
# Thread pool
PRIVATE platform/default/mbgl/util/shared_thread_pool.cpp
PRIVATE platform/default/mbgl/util/shared_thread_pool.hpp
@@ -36,6 +33,7 @@ set(MBGL_QT_CORE_FILES
# Platform integration
PRIVATE platform/qt/src/async_task.cpp
PRIVATE platform/qt/src/async_task_impl.hpp
+ PRIVATE platform/qt/src/qt_logging.cpp
PRIVATE platform/qt/src/qt_image.cpp
PRIVATE platform/qt/src/run_loop.cpp
PRIVATE platform/qt/src/run_loop_impl.hpp
diff --git a/platform/qt/src/qt_logging.cpp b/platform/qt/src/qt_logging.cpp
new file mode 100755
index 0000000000..acbe9562d0
--- /dev/null
+++ b/platform/qt/src/qt_logging.cpp
@@ -0,0 +1,12 @@
+#include <mbgl/util/logging.hpp>
+#include <mbgl/util/enum.hpp>
+
+#include <QDebug>
+
+namespace mbgl {
+
+void Log::platformRecord(EventSeverity severity, const std::string &msg) {
+ qWarning() << "[" << Enum<EventSeverity>::toString(severity) << "] " << QString::fromStdString(msg);
+}
+
+} // namespace mbgl