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.
This commit is contained in:
Thiago Marcos P. Santos
2015-06-24 15:10:23 +03:00
parent 57ddb386d8
commit b56c356de7

View File

@@ -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) {