Set ANDROID_LOG_NAME depending on application
authorDmitry Shmidt <dimitrysh@google.com>
Fri, 21 Oct 2011 14:26:35 +0000 (17:26 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 21 Oct 2011 15:59:42 +0000 (18:59 +0300)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
hostapd/Android.mk
src/utils/wpa_debug.c
wpa_supplicant/Android.mk

index aa9d5ba..2b53f03 100644 (file)
@@ -13,6 +13,9 @@ include $(LOCAL_PATH)/.config
 # To ignore possible wrong network configurations
 L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
 
+# Set Android log name
+L_CFLAGS += -DANDROID_LOG_NAME=\"hostapd\"
+
 # To force sizeof(enum) = 4
 ifeq ($(TARGET_ARCH),arm)
 L_CFLAGS += -mabi=aapcs-linux
index b8c5e2f..5b56d83 100644 (file)
@@ -32,6 +32,10 @@ int wpa_debug_timestamp = 0;
 
 #include <android/log.h>
 
+#ifndef ANDROID_LOG_NAME
+#define ANDROID_LOG_NAME       "wpa_supplicant"
+#endif /* ANDROID_LOG_NAME */
+
 void android_printf(int level, char *format, ...)
 {
        if (level >= wpa_debug_level) {
@@ -45,7 +49,7 @@ void android_printf(int level, char *format, ...)
                else
                        level = ANDROID_LOG_DEBUG;
                va_start(ap, format);
-               __android_log_vprint(level, "wpa_supplicant", format, ap);
+               __android_log_vprint(level, ANDROID_LOG_NAME, format, ap);
                va_end(ap);
        }
 }
index 79a2146..5fe1abd 100644 (file)
@@ -31,6 +31,9 @@ include $(LOCAL_PATH)/.config
 # To ignore possible wrong network configurations
 L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
 
+# Set Android log name
+L_CFLAGS += -DANDROID_LOG_NAME=\"wpa_supplicant\"
+
 # Use Android specific directory for control interface sockets
 L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/misc/wifi/sockets\"
 L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/system/wpa_supplicant\"