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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user