From 9661983ab7964d195432d905f721f9dd59163edc Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Mon, 29 Mar 2010 16:05:50 -0700 Subject: Leave only error messages Change-Id: Icd6f44019098c62aa2aaa0845a28beb95120bd62 Signed-off-by: Dmitry Shmidt --- logger.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/logger.c b/logger.c index 46d179a..677228c 100644 --- a/logger.c +++ b/logger.c @@ -39,7 +39,7 @@ #include #endif -static int loglevel = LOG_INFO; +static int loglevel = LOG_ERR; static char logprefix[12] = {0}; void @@ -64,12 +64,14 @@ logger(int level, const char *fmt, ...) va_start(p, fmt); #ifdef ANDROID - if (level <= LOG_ERR) { - level = ANDROID_LOG_ERROR; - } else { - level = ANDROID_LOG_DEBUG; + if (level <= loglevel) { + if (level <= LOG_ERR) { + level = ANDROID_LOG_ERROR; + } else { + level = ANDROID_LOG_DEBUG; + } + __android_log_vprint(level, "dhcpcd", fmt, p); } - __android_log_vprint(level, "dhcpcd", fmt, p); #else va_copy(p2, p); -- cgit v1.1