diff --git a/base/BLog.c b/base/BLog.c index 0660cd77d..bd4b345d8 100644 --- a/base/BLog.c +++ b/base/BLog.c @@ -49,12 +49,18 @@ struct _BLog_global blog_global = {0}; // keep in sync with level numbers in BLog.h! static char *level_names[] = { NULL, "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG" }; +#ifdef __ANDROID__ +static int android_log_level_map[] = {ANDROID_LOG_FATAL, ANDROID_LOG_ERROR, ANDROID_LOG_WARN, + ANDROID_LOG_INFO, ANDROID_LOG_INFO, ANDROID_LOG_DEBUG +}; +#endif + static void stdout_log (int channel, int level, const char *msg) { #ifndef __ANDROID__ fprintf(stdout, "%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg); #else - __android_log_print(ANDROID_LOG_DEBUG, "tun2socks", + __android_log_print(android_log_level_map[level], "tun2socks", "%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg); #endif } @@ -64,7 +70,7 @@ static void stderr_log (int channel, int level, const char *msg) #ifndef __ANDROID__ fprintf(stderr, "%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg); #else - __android_log_print(ANDROID_LOG_ERROR, "tun2socks", + __android_log_print(android_log_level_map[level], "tun2socks", "%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg); #endif } diff --git a/tun2socks/tun2socks.c b/tun2socks/tun2socks.c index de5ce4f10..b4352bcf9 100644 --- a/tun2socks/tun2socks.c +++ b/tun2socks/tun2socks.c @@ -1218,7 +1218,9 @@ void lwip_init_job_hadler (void *unused) { ASSERT(!quitting) ASSERT(netif_ipaddr.type == BADDR_TYPE_IPV4) +#ifndef __ANDROID__ ASSERT(netif_netmask.type == BADDR_TYPE_IPV4) +#endif ASSERT(!have_netif) ASSERT(!listener) ASSERT(!listener_ip6)