adb: call android::base::InitLogging even when adb tracing is disabled

This is a follow-up to https://android-review.googlesource.com/153623
which prevented android::base::InitLogging() from being called when
tracing was disabled.

It is ok to call InitLogging() on a device or host because calling it
does not imply that a logging file is used, which was the reason for
not calling it on a device.

So this change should preserve the device behavior of not using a
logging file when tracing is disabled, plus it will call InitLogging()
all the time in case logging APIs are called.

Change-Id: I3fd6ba2c567f67a2f111a85f174893fbf866ec57
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
This commit is contained in:
Spencer Low 2015-08-11 15:48:15 -07:00
parent 7989a7c8d3
commit 7430916098
1 changed files with 5 additions and 8 deletions

View File

@ -192,16 +192,13 @@ static void setup_trace_mask() {
}
void adb_trace_init(char** argv) {
#if !ADB_HOST
// Don't open log file if no tracing, since this will block
// the crypto unmount of /data
const std::string trace_setting = get_trace_setting();
if (trace_setting.empty()) {
return;
}
#if !ADB_HOST
if (isatty(STDOUT_FILENO) == 0) {
start_device_log();
if (!get_trace_setting().empty()) {
if (isatty(STDOUT_FILENO) == 0) {
start_device_log();
}
}
#endif