diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2015-03-09 15:42:11 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-03-12 13:28:40 +0200 |
commit | 2948e7d121343359b817d2fb0eb383e257ab84c8 (patch) | |
tree | f16ef0c923774abe4d2eb2c2e888ffe22238e926 /platform/darwin | |
parent | ba9d2420699507c6d32b12272151529663c8d2fd (diff) | |
download | qtlocation-mapboxgl-2948e7d121343359b817d2fb0eb383e257ab84c8.tar.gz |
Simplify the logging mechanism
Move the implementation of the more specialized methods to the base
class and let the platform implement only the most generic method that
takes all the possible arguments.
These specialized methods will then map to the generic implementation
that must be provided by the platforms we support.
Diffstat (limited to 'platform/darwin')
-rw-r--r-- | platform/darwin/log_nslog.mm | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/platform/darwin/log_nslog.mm b/platform/darwin/log_nslog.mm index a82d78a01f..edcf41ebb2 100644 --- a/platform/darwin/log_nslog.mm +++ b/platform/darwin/log_nslog.mm @@ -2,34 +2,8 @@ #import <Foundation/Foundation.h> -#include <cstdarg> - namespace mbgl { -void NSLogBackend::record(EventSeverity severity, Event event, const std::string &msg) { - NSString *message = - [[NSString alloc] initWithBytes:msg.data() length:msg.size() encoding:NSUTF8StringEncoding]; - NSLog(@"[%s] %s: %@", EventSeverityClass(severity).c_str(), EventClass(event).c_str(), message); -} - -void NSLogBackend::record(EventSeverity severity, Event event, const char *format, ...) { - va_list args; - va_start(args, format); - const size_t len = vsnprintf(NULL, 0, format, args); - va_end(args); - std::unique_ptr<char[]> buffer(new char[len + 1]); - va_start(args, format); - vsnprintf(buffer.get(), len + 1, format, args); - va_end(args); - NSLog(@"[%s] %s: %s", EventSeverityClass(severity).c_str(), EventClass(event).c_str(), - buffer.get()); -} - -void NSLogBackend::record(EventSeverity severity, Event event, int64_t code) { - NSLog(@"[%s] %s: (%lld)", EventSeverityClass(severity).c_str(), EventClass(event).c_str(), - code); -} - void NSLogBackend::record(EventSeverity severity, Event event, int64_t code, const std::string &msg) { NSString *message = |