KurtCobain
KurtCobain

Reputation: 631

How to get Verbose logging in logcat for a specific module

One of the android Modules (AudioFlinger) has support for verbose logging (with Tag=AudioFlinger). Question is how can I see those logs in the logcat?

I did the setprop log.tag.AudioFlinger VERBOSE - but it doesn't seem to work. Do I need to change something and then rebuild the android source again?

Upvotes: 14

Views: 27050

Answers (2)

SD.
SD.

Reputation: 1500

Use any of the below methods.

1) Add or uncomment "`#define LOG_NDEBUG 0`" at top of any module file.
2) In Android.mk or <module>.mk file, add `LOCAL_CFLAGS += -DLOG_NDEBUG=0`

In logcat, logcat | grep -E 'tag1|tag2'.

Upvotes: 5

KurtCobain
KurtCobain

Reputation: 631

The logcat documentation doesn't really help. But with more digging I was able to find the answer, as I was expecting the VERBOSE logging is by default OFF at compile time.

Looking at the cutils/log.h helps to find the answer: http://www.netmite.com/android/mydroid/system/core/include/cutils/log.h

/*
 * Normally we strip LOGV (VERBOSE messages) from release builds.
 * You can modify this (for example with "#define LOG_NDEBUG 0"
 * at the top of your source file) to change that behavior.
 */

So to enable VERBOSE for any source file/module : We have to define LOG_NDEBUG as 0

Upvotes: 28

Related Questions