add relativePath support for iOS

This commit is contained in:
guoling
2019-12-24 22:13:42 +08:00
parent c88a5eb695
commit 9364d0ccfd
29 changed files with 205 additions and 274 deletions
+3 -6
View File
@@ -44,8 +44,7 @@ static android_LogPriority MMKVLogLevelDesc(MMKVLogLevel level) {
}
}
void _MMKVLogWithLevel(
MMKVLogLevel level, const char *file, const char *func, int line, const char *format, ...) {
void _MMKVLogWithLevel(MMKVLogLevel level, const char *file, const char *func, int line, const char *format, ...) {
if (level >= g_currentLogLevel) {
string message;
char buffer[16];
@@ -62,16 +61,14 @@ void _MMKVLogWithLevel(
} else {
message.resize(static_cast<unsigned long>(length), '\0');
va_start(args, format);
std::vsnprintf(const_cast<char *>(message.data()), static_cast<size_t>(length) + 1,
format, args);
std::vsnprintf(const_cast<char *>(message.data()), static_cast<size_t>(length) + 1, format, args);
va_end(args);
}
if (g_logHandler) {
g_logHandler(level, file, line, func, message);
} else {
__android_log_print(MMKVLogLevelDesc(level), APP_NAME, "<%s:%d::%s> %s", file, line,
func, message.c_str());
__android_log_print(MMKVLogLevelDesc(level), APP_NAME, "<%s:%d::%s> %s", file, line, func, message.c_str());
}
}
}