summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2015-03-09 16:15:18 +0200
committerThiago Marcos P. Santos <thiago@mapbox.com>2015-03-12 13:28:41 +0200
commit51bc265db341f1d98b4fd46be80241771f854eb5 (patch)
treedc77abcdc9b423b59da94d32ae2afb0f57fb6f8d /platform/android
parent2948e7d121343359b817d2fb0eb383e257ab84c8 (diff)
downloadqtlocation-mapboxgl-51bc265db341f1d98b4fd46be80241771f854eb5.tar.gz
Make the logging system static
No initialization is needed anymore and we can use the logging functions safely at any point of the code (threading is not handled though, so you might get multiplexed messages if you log from two threads simultaneously).
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/log_android.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/platform/android/log_android.cpp b/platform/android/log_android.cpp
index e1bec3e0cb..9de8232bac 100644
--- a/platform/android/log_android.cpp
+++ b/platform/android/log_android.cpp
@@ -1,4 +1,4 @@
-#include <mbgl/platform/android/log_android.hpp>
+#include <mbgl/platform/log.hpp>
#define __STDC_FORMAT_MACROS // NDK bug workaround: https://code.google.com/p/android/issues/detail?id=72349
#include <cinttypes>
@@ -7,7 +7,9 @@
namespace mbgl {
-int AndroidLogBackend::severityToPriority(EventSeverity severity) {
+namespace {
+
+int severityToPriority(EventSeverity severity) {
switch(severity) {
case EventSeverity::Debug:
return ANDROID_LOG_DEBUG;
@@ -26,7 +28,9 @@ int AndroidLogBackend::severityToPriority(EventSeverity severity) {
}
}
-void AndroidLogBackend::record(EventSeverity severity, Event event, int64_t code, const std::string &msg) {
+} // namespace
+
+void Log::platformRecord(EventSeverity severity, Event event, int64_t code, const std::string &msg) {
__android_log_print(severityToPriority(severity), EventClass(event).c_str(), "(%" PRId64 ") %s", code, msg.c_str());
}