summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2015-06-24 15:10:23 +0300
committerThiago Marcos P. Santos <thiago@mapbox.com>2015-06-25 16:26:21 +0300
commitb56c356de71a3edec76984ddf4202c92930bd17b (patch)
tree7b34e905048e421b1781b9b869471c975d1d25fe /src
parent57ddb386d8d1cbc71856abd48b62441294a175b8 (diff)
downloadqtlocation-mapboxgl-b56c356de71a3edec76984ddf4202c92930bd17b.tar.gz
Use ThreadContext data for logging
Do not use the Environment anymore. The Environment ID is not really necessary anymore as we are forwarding exceptions to the main thread, so we always know which Map object triggered the error.
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/platform/log.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/mbgl/platform/log.cpp b/src/mbgl/platform/log.cpp
index 380113d7dc..eec33444b9 100644
--- a/src/mbgl/platform/log.cpp
+++ b/src/mbgl/platform/log.cpp
@@ -1,6 +1,6 @@
#include <mbgl/platform/log.hpp>
-#include <mbgl/map/environment.hpp>
+#include <mbgl/util/thread_context.hpp>
#include <cstdarg>
#include <sstream>
@@ -48,16 +48,7 @@ void Log::record(EventSeverity severity, Event event, int64_t code, const std::s
}
std::stringstream logStream;
-
- if (Environment::inScope()) {
- logStream << "{" << Environment::Get().getID() << "}";
- }
-
- const std::string threadName = Environment::threadName();
- if (!threadName.empty()) {
- logStream << "{" << threadName << "}";
- }
-
+ logStream << "{" << util::ThreadContext::getName() << "}";
logStream << "[" << event << "]";
if (code >= 0) {