diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2010-02-16 15:20:48 -0800 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2010-02-16 15:20:48 -0800 |
commit | 80545bf964016dd8dfcfa5a1814dd515fa8b2132 (patch) | |
tree | 7db8bbca04c313059fbfcd24257a3d49e79c56cf | |
parent | a557a19eed2f9eb8869aeaffca7a6cda076b0770 (diff) | |
download | external_dhcpcd-80545bf964016dd8dfcfa5a1814dd515fa8b2132.zip external_dhcpcd-80545bf964016dd8dfcfa5a1814dd515fa8b2132.tar.gz external_dhcpcd-80545bf964016dd8dfcfa5a1814dd515fa8b2132.tar.bz2 |
Add dhcpcd Android debug output
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r-- | logger.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -35,6 +35,10 @@ #include "common.h" #include "logger.h" +#ifdef ANDROID +#include <android/log.h> +#endif + static int loglevel = LOG_INFO; static char logprefix[12] = {0}; @@ -59,6 +63,14 @@ logger(int level, const char *fmt, ...) char *fmt2, *pf; va_start(p, fmt); +#ifdef ANDROID + if (level <= LOG_ERR) { + level = ANDROID_LOG_ERROR; + } else { + level = ANDROID_LOG_DEBUG; + } + __android_log_vprint(level, "dhcpcd", fmt, p); +#else va_copy(p2, p); if (level <= LOG_ERR || level <= loglevel) { @@ -85,5 +97,6 @@ logger(int level, const char *fmt, ...) } va_end(p2); +#endif va_end(p); } |