summaryrefslogtreecommitdiff
path: root/src/mbgl/platform/log.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/platform/log.cpp')
-rw-r--r--src/mbgl/platform/log.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mbgl/platform/log.cpp b/src/mbgl/platform/log.cpp
index 580c698699..2118511592 100644
--- a/src/mbgl/platform/log.cpp
+++ b/src/mbgl/platform/log.cpp
@@ -1,7 +1,5 @@
#include <mbgl/platform/log.hpp>
-#include <mbgl/util/thread_context.hpp>
-
#include <cstdio>
#include <cstdarg>
#include <sstream>
@@ -49,7 +47,13 @@ void Log::record(EventSeverity severity, Event event, int64_t code, const std::s
}
std::stringstream logStream;
- logStream << "{" << util::ThreadContext::getName() << "}";
+
+ #if !defined(__ANDROID__) && (defined( __APPLE__) || defined(__linux__))
+ char name[32];
+ pthread_getname_np(pthread_self(), name, sizeof(name));
+ logStream << "{" << name << "}";
+ #endif
+
logStream << "[" << event << "]";
if (code >= 0) {