To make it easier to debug, add the Environment ID and the Thread name
to the log messages. For instance log messages from the TileParser will look like:
[WARNING] {0}{TileWorker_15/18653/9486}[ParseTile]: some relevant warning message
| | | |
| | | +-> Component
| | +--------------------> Thread name
| +----------------------------------> Environment ID
+------------------------------------------> Severity level
Log messages that are not inside an Environment::Scope will work
normally and will look like:
[WARNING] [JNI]: some relevant warning message
Fixes #882.
12 lines
215 B
C++
12 lines
215 B
C++
#include <mbgl/platform/log.hpp>
|
|
|
|
#include <iostream>
|
|
|
|
namespace mbgl {
|
|
|
|
void Log::platformRecord(EventSeverity severity, const std::string &msg) {
|
|
std::cerr << "[" << severity << "] " << msg << std::endl;
|
|
}
|
|
|
|
}
|