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?
Logcat is a command-line tool that dumps a log of system messages, including stack traces when the device throws an error and messages that you have written from your app with the Log class. This page is about the command-line logcat tool, but you can also view log messages from the Logcat window in Android Studio.
Verbose logging is a type of computer logging method that involves more information than the standard or typical logging process. Typically, users can turn on verbose logging features to get more information about a system.
By default, logcat displays just the log messages for your app running on the device. To change this default, see how to filter logcat messages. The Logcat toolbar provides the following buttons: Clear logcat : Click to clear the visible log. Scroll to the end : Click to jump to the bottom of the log and see the latest log messages.
Logcat is a command-line tool that dumps a log of system messages, including stack traces when the device throws an error and messages that you have written from your app with the Log class.
Logcat is a command-line tool that dumps a log of system messages, including stack traces when the device throws an error and messages that you have written from your app with the Log class. This page is about the command-line logcat tool, but you can also view log messages from the Logcat window in Android Studio.
You can run logcat as an adb command or directly in a shell prompt of your emulator or connected device. To view log output using adb, navigate to your SDK platform-tools/ directory and execute: For logcat online help, start a device and then execute: The following table describes the command line options of logcat.
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'.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With