Invalid Android ADB LogCat environment variable: ANDROID_PRINTF_LOG

When I execute adb logcat --help

, Logcat usage data is printed. The bottom section describes two environment variables:

"If not specified on the command line, filterpec is set from ANDROID_LOG_TAGS . If no filters are found, the default is '*: I'

If -v is not specified, the format is set from ANDROID_PRINTF_LOG or the default is "short"


On my Windows 7 machine, when I add ANDROID_LOG_TAGS to my environment variables with the value "Foo: * *: S" for example, then it works! Calling adb logcat

without tag filters will default to my custom values. Fine!

However, when I add ANDROID_PRINTF_LOG , with any valid setting (I prefer "time"), it will not affect the logcat output. adb logcat

is still displayed in "short" format.


Is there some mistake I am making or something I can do to make it work? I would really like this to work because I use "-v time" a lot.

My ADB version is 1.0.31.

Thanks in advance.

The Android pages themselves did not mention this variable:
http://developer.android.com/tools/help/logcat.html
http://developer.android.com/tools/debugging/debugging-log.html#outputFormat

+3


source to share


1 answer


ANDROID_PRINTF_LOG and ANDROID_LOG_TAGS are handled by the binary logcat

on the device side. This means that in order to affect the output format, variables must be set inside the shell of the device shell. And you install them in the PC shell environment. The reason ANDROID_LOG_TAGS works when installed on the PC side is as follows:

At startup adb logcat

, the actual command being executed is executed:



adb shell export ANDROID_LOG_TAGS=\"%ANDROID_LOG_TAGS%\"; exec logcat

      

i.e. your local ANDROID_LOG_TAGS value is copied to the device environment before every call logcat

. Not sure if not copying ANDROID_PRINTF_LOG this might also be a bug. adb -h

all the variables supported on the PC side are listed, and ANDROID_PRINTF_LOG is not among them.

+2


source







All Articles