[android] - modularise the sdk

This commit is contained in:
tobrun
2018-07-17 15:05:53 +02:00
committed by Tobrun
parent 0f58d956d7
commit d297bf10ef
51 changed files with 1508 additions and 503 deletions

View File

@@ -1,34 +1,13 @@
#include <mbgl/util/logging.hpp>
#include <android/log.h>
#include "logger.hpp"
#include "attach_env.hpp"
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());
auto env{ android::AttachEnv() };
android::Logger::log(*env, severity, msg);
}
}
}