adb: clean up debug tracing a little.
Always use LOG() for debug tracing.
Remove useless D_lock. I believe it is useless to lock just before and after fprintf.
I verified the log output both on host and on device. The output looks fine to me.
Change-Id: I96ccfe408ff56864361551afe9ad464d197ae104
diff --git a/adb/daemon/main.cpp b/adb/daemon/main.cpp
index 2eba625..cb0cb3d 100644
--- a/adb/daemon/main.cpp
+++ b/adb/daemon/main.cpp
@@ -162,7 +162,7 @@
PLOG(FATAL) << "Could not setuid";
}
- D("Local port disabled\n");
+ D("Local port disabled");
} else {
if (root_seclabel != nullptr) {
if (setcon(root_seclabel) < 0) {
@@ -197,7 +197,7 @@
int port;
if (sscanf(prop_port, "%d", &port) == 1 && port > 0) {
- printf("using port=%d\n", port);
+ D("using port=%d", port);
// Listen on TCP port specified by service.adb.tcp.port property.
local_init(port);
} else if (!is_usb) {
@@ -205,11 +205,11 @@
local_init(DEFAULT_ADB_LOCAL_TRANSPORT_PORT);
}
- D("adbd_main(): pre init_jdwp()\n");
+ D("adbd_main(): pre init_jdwp()");
init_jdwp();
- D("adbd_main(): post init_jdwp()\n");
+ D("adbd_main(): post init_jdwp()");
- D("Event loop starting\n");
+ D("Event loop starting");
fdevent_loop();
return 0;
@@ -261,6 +261,6 @@
adb_trace_init(argv);
- D("Handling main()\n");
+ D("Handling main()");
return adbd_main(DEFAULT_ADB_PORT);
}