Disabling wpa_supplicant logs

1,082 views
Skip to first unread message

guru

unread,
Jun 11, 2010, 10:05:42 AM6/11/10
to android-porting
HI all

in many of the wpa_supplicant code they are using ENTER and LEAVE
macros to display the logs(Below). At last it will call
android_printf.

I want to make sure that only message with MSG_WARNING should be
displayed. so what I did is I assigned

wpa_debug_leve = MSG_WARNING so since

MSG_DEBUG value is < than MSG_WARNING, so it wont display.

#define ENTER() wpa_printf(MSG_DEBUG, "WPA_SUPP: enter into %s",
__FUNCTION__)
#define LEAVE() wpa_printf(MSG_DEBUG, "WPA_SUPP: leave from %s",
__FUNCTION__)


define wpa_printf(level, ...) \
do { \
android_printf((level), __VA_ARGS__); \
} while (0)

void android_printf(int level, char *format, ...)
{
if (level >= wpa_debug_level) {
va_list ap;
if (level == MSG_ERROR) {
level = ANDROID_LOG_ERROR;
} else if (level == MSG_WARNING) {
level = ANDROID_LOG_WARN;
} else if (level == MSG_INFO) {
level = ANDROID_LOG_INFO;
} else {
level = ANDROID_LOG_DEBUG;
}
va_start(ap, format);
__android_log_vprint(level, "wpa_supplicant", format,
ap);
va_end(ap);
}
}


But still it is displaying the logs with MSG_DEBUG level. please let
me know where I am going wrong. How to disable these logs?

Thanks
Gururaja B O

Manav Gautama

unread,
Jun 11, 2010, 10:21:48 AM6/11/10
to guru....@gmail.com, android-porting
On Fri, Jun 11, 2010 at 7:35 PM, guru <guru....@gmail.com> wrote:
HI all

in many of the wpa_supplicant code they are using ENTER and LEAVE
macros to display the logs(Below). At last it will call
android_printf.

I want to make sure that only message with MSG_WARNING should be
displayed. so what I did is I assigned

wpa_debug_leve = MSG_WARNING so since

Shouldn't this be wpa_debug_level Guru ?  

guru

unread,
Jun 11, 2010, 10:29:16 AM6/11/10
to android-porting
Sorry Manav, it was typing mistake. is is wpa_debug_level only.

On Jun 11, 7:21 pm, Manav Gautama <bandwidthcru...@gmail.com> wrote:
> > unsubscribe: android-porti...@googlegroups.com<android-porting%2Bunsu...@googlegroups.com>
> > website:http://groups.google.com/group/android-porting

guru

unread,
Jun 15, 2010, 12:17:57 AM6/15/10
to android-porting
Hi all

this wpa_debug_level is again re-initialized in
wpa_supplicant.c(wpa_supplicant_init) to -1. so always debug messages
are coming.

wpa_debug_level = global->params.wpa_debug_level = params-
>wpa_debug_level;

Please let me know what I need to avoid this one?

Thanks
Gururaja b O

梁亦飞

unread,
Jun 16, 2010, 9:42:16 AM6/16/10
to android...@googlegroups.com
Hi Guru
You can decide the wpa_debug_level through the commond line option -d.
If you don't use this option, the default value is MSG_INFO.

You can also disable all the stdout message by compile the wpa_supplicant
with CONFIG_NO_STDOUT_DEBUG.

By the way,the value of all the debug level is as fallows:
enum { MSG_MSGDUMP, MSG_DEBUG, MSG_INFO, MSG_WARNING, MSG_ERROR };


2010/6/15 guru <guru....@gmail.com>:

Reply all
Reply to author
Forward
0 new messages