Merge "Make "adb logcat" pass $ANDROID_LOG_TAGS through again."
This commit is contained in:
commit
b838ff65d9
1 changed files with 17 additions and 0 deletions
|
|
@ -155,7 +155,24 @@ void adb_trace_init(char** argv) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(_WIN32)
|
||||||
|
// adb historically ignored $ANDROID_LOG_TAGS but passed it through to logcat.
|
||||||
|
// If set, move it out of the way so that libbase logging doesn't try to parse it.
|
||||||
|
std::string log_tags;
|
||||||
|
char* ANDROID_LOG_TAGS = getenv("ANDROID_LOG_TAGS");
|
||||||
|
if (ANDROID_LOG_TAGS) {
|
||||||
|
log_tags = ANDROID_LOG_TAGS;
|
||||||
|
unsetenv("ANDROID_LOG_TAGS");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
android::base::InitLogging(argv, &AdbLogger);
|
android::base::InitLogging(argv, &AdbLogger);
|
||||||
|
|
||||||
|
#if !defined(_WIN32)
|
||||||
|
// Put $ANDROID_LOG_TAGS back so we can pass it to logcat.
|
||||||
|
if (!log_tags.empty()) setenv("ANDROID_LOG_TAGS", log_tags.c_str(), 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
setup_trace_mask();
|
setup_trace_mask();
|
||||||
|
|
||||||
VLOG(ADB) << adb_version();
|
VLOG(ADB) << adb_version();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue