[android] Simplify structure for native files

This commit is contained in:
John Firebaugh
2015-12-16 15:24:37 -08:00
parent 989690c4af
commit 2b782308e5
11 changed files with 14 additions and 15 deletions

View File

@@ -0,0 +1,34 @@
#include <mbgl/platform/log.hpp>
#include <android/log.h>
namespace mbgl {
namespace {
int severityToPriority(EventSeverity severity) {
switch(severity) {
case EventSeverity::Debug:
return ANDROID_LOG_DEBUG;
case EventSeverity::Info:
return ANDROID_LOG_INFO;
case EventSeverity::Warning:
return ANDROID_LOG_WARN;
case EventSeverity::Error:
return ANDROID_LOG_ERROR;
default:
return ANDROID_LOG_VERBOSE;
}
}
} // namespace
void Log::platformRecord(EventSeverity severity, const std::string &msg) {
__android_log_print(severityToPriority(severity), "mbgl", "%s", msg.c_str());
}
}