Reputation: 594
When I execute adb logcat --help
, the Logcat usage details are printed. Near the bottom, it describes two environment variables:
"If not specified on the commandline, filterspec is set from ANDROID_LOG_TAGS. If no filterspec is found, filter defaults to '*:I'
If not specified with -v, format is set from ANDROID_PRINTF_LOG or defaults to 'brief'"
On my Windows 7 machine, when I add ANDROID_LOG_TAGS to my environment variables with a value of "Foo:* *:S", for example, then it works! Calling adb logcat
without tag filters will default to my custom values. Great!
However, when I add ANDROID_PRINTF_LOG, with any valid setting (I prefer "time"), this will NOT have an affect on the logcat output. adb logcat
still outputs in "brief" format.
Is there some mistake I am making, or something I can do to get to work??
I would really like to get this working because I use "-v time" a lot.
My ADB version is 1.0.31.
Thanks in advance.
Android pages themselves didn't mention this variable:
http://developer.android.com/tools/help/logcat.html
http://developer.android.com/tools/debugging/debugging-log.html#outputFormat
Upvotes: 3
Views: 1264
Reputation: 31686
ANDROID_PRINTF_LOG and ANDROID_LOG_TAGS are processed by the logcat
binary running on the device side. It means that in order to affect the output format the variables need to be set inside of the device's shell environment. And you are setting them in your PC's shell environment. The reason why ANDROID_LOG_TAGS still works when set on the PC side is the following:
When you run the adb logcat
the actual command being executed is this:
adb shell export ANDROID_LOG_TAGS=\"%ANDROID_LOG_TAGS%\"; exec logcat
i.e. your local ANDROID_LOG_TAGS value is being copied into the device's environment before every logcat
call. Not sure if not copying the ANDROID_PRINTF_LOG as well qualifies as a bug though. adb -h
lists all the variables supported on the PC side and ANDROID_PRINTF_LOG is not among them.
Upvotes: 3