aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Grossman <johngro@google.com>2012-04-20 13:31:13 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-04-20 13:31:13 -0700
commite4f0d1bd87c052c1b4af410599558de1e8875379 (patch)
tree9fd9424e25f38abf3ff45a0962ce190cf839ef7d
parent31182b2e5676319b0b9c8d5c1ef8eda85051de97 (diff)
parent6a7ffa31d45635b56558b9ba8bbd05fc002e1fa4 (diff)
downloadexternal_dhcpcd-e4f0d1bd87c052c1b4af410599558de1e8875379.zip
external_dhcpcd-e4f0d1bd87c052c1b4af410599558de1e8875379.tar.gz
external_dhcpcd-e4f0d1bd87c052c1b4af410599558de1e8875379.tar.bz2
am 6a7ffa31: DHCPCD: Add the ability to redirect log to logcat.
* commit '6a7ffa31d45635b56558b9ba8bbd05fc002e1fa4': DHCPCD: Add the ability to redirect log to logcat.
-rw-r--r--common.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/common.h b/common.h
index fbbfc18..65b060f 100644
--- a/common.h
+++ b/common.h
@@ -79,4 +79,33 @@ void *xmalloc(size_t);
void *xzalloc(size_t);
char *xstrdup(const char *);
+/* Uncomment the #def below to send DHCPCD syslog messages to Android's logcat
+ * instead. */
+/* #define REDIRECT_SYSLOG_TO_ANDROID_LOGCAT */
+#ifdef REDIRECT_SYSLOG_TO_ANDROID_LOGCAT
+
+#define LOG_TAG "DHCPCD"
+#include <utils/Log.h>
+
+#undef LOG_EMERG
+#undef LOG_ALERT
+#undef LOG_CRIT
+#undef LOG_ERR
+#undef LOG_WARNING
+#undef LOG_NOTICE
+#undef LOG_INFO
+#undef LOG_DEBUG
+
+#define LOG_EMERG ANDROID_LOG_FATAL
+#define LOG_ALERT ANDROID_LOG_FATAL
+#define LOG_CRIT ANDROID_LOG_FATAL
+#define LOG_ERR ANDROID_LOG_ERROR
+#define LOG_WARNING ANDROID_LOG_WARN
+#define LOG_NOTICE ANDROID_LOG_WARN
+#define LOG_INFO ANDROID_LOG_INFO
+#define LOG_DEBUG ANDROID_LOG_DEBUG
+#define syslog(a, b...) android_printLog(a, LOG_TAG, b)
+
+#endif /* REDIRECT_SYSLOG_TO_ANDROID_LOGCAT */
+
#endif