From 4ba80ad5d443278d315df65e4ed0ffb0610aa864 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Sat, 3 Dec 2016 19:46:39 -0500 Subject: [PATCH] ndk_patches: Better syslog -> logcat translation Never log ANDROID_LOG_SILENT or ANDROID_LOG_FATAL. --- ndk_patches/syslog.patch | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ndk_patches/syslog.patch b/ndk_patches/syslog.patch index 77d9293b0..67a1dc624 100644 --- a/ndk_patches/syslog.patch +++ b/ndk_patches/syslog.patch @@ -10,7 +10,7 @@ diff -Nur /Users/fornwall/lib/android-ndk/platforms/android-18/arch-arm/usr/incl __BEGIN_DECLS -@@ -111,6 +112,65 @@ +@@ -111,6 +112,64 @@ extern void syslog_r(int, struct syslog_data *, const char *, ...); extern void vsyslog_r(int, struct syslog_data *, const char *, va_list); @@ -24,13 +24,12 @@ diff -Nur /Users/fornwall/lib/android-ndk/platforms/android-18/arch-arm/usr/incl + +static __inline__ void android_polyfill_vsyslog(int syslog_priority, char const* format, va_list ap) +{ -+ android_LogPriority a = ANDROID_LOG_FATAL; ++ android_LogPriority a = ANDROID_LOG_ERROR; + switch (syslog_priority) { -+ case LOG_INFO : a = ANDROID_LOG_SILENT ; break; -+ case LOG_EMERG : a = ANDROID_LOG_FATAL ; break; -+ case LOG_ERR : a = ANDROID_LOG_ERROR ; break; -+ case LOG_WARNING : a = ANDROID_LOG_WARN ; break; -+ case LOG_DEBUG : a = ANDROID_LOG_VERBOSE ; break; ++ case LOG_WARNING: a = ANDROID_LOG_WARN; break; ++ case LOG_NOTICE : a = ANDROID_LOG_INFO; break; ++ case LOG_INFO: a = ANDROID_LOG_INFO; break; ++ case LOG_DEBUG: a = ANDROID_LOG_DEBUG; break; + } + char* syslog_text; + if (vasprintf(&syslog_text, format, ap) == -1) {