diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-03-15 03:20:53 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-03-18 12:51:33 +0100 |
commit | 3254cdc85c4a836cb57b2b56770e5a1ec26adc23 (patch) | |
tree | 4898d19879ecf1825309cd7f9c43faa24b14f97b /platform/darwin | |
parent | 66841bf7eb0d85b5f7c38092e17b9cc16a1dc18a (diff) | |
download | qtlocation-mapboxgl-3254cdc85c4a836cb57b2b56770e5a1ec26adc23.tar.gz |
Log the Environment ID and the Thread name
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.
Diffstat (limited to 'platform/darwin')
-rw-r--r-- | platform/darwin/log_nslog.mm | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/platform/darwin/log_nslog.mm b/platform/darwin/log_nslog.mm index 5d53ed812f..a2e31968ab 100644 --- a/platform/darwin/log_nslog.mm +++ b/platform/darwin/log_nslog.mm @@ -4,12 +4,10 @@ namespace mbgl { -void Log::platformRecord(EventSeverity severity, Event event, int64_t code, - const std::string &msg) { +void Log::platformRecord(EventSeverity severity, const std::string &msg) { NSString *message = [[NSString alloc] initWithBytes:msg.data() length:msg.size() encoding:NSUTF8StringEncoding]; - NSLog(@"[%s] %s: (%lld) %@", EventSeverityClass(severity).c_str(), EventClass(event).c_str(), - code, message); + NSLog(@"[%s] %@", EventSeverityClass(severity).c_str(), message); } } |