adbd: add runtime-configurable logging.
Add some requested logging options that can be turned on at runtime
without having to restart adbd.
Bug: http://b/141959374
Test: manual
Change-Id: Ib97acc6d199e0b91238a6758e18b7cb75f8688d9
diff --git a/adb.cpp b/adb.cpp
index 554a754..98db191 100644
--- a/adb.cpp
+++ b/adb.cpp
@@ -34,6 +34,7 @@
#include <condition_variable>
#include <mutex>
#include <string>
+#include <string_view>
#include <thread>
#include <vector>
@@ -61,6 +62,8 @@
#include <sys/mount.h>
#include <android-base/properties.h>
using namespace std::chrono_literals;
+
+#include "daemon/logging.h"
#endif
std::string adb_version() {
@@ -312,6 +315,9 @@
#if ADB_HOST
handle_online(t);
#else
+ ADB_LOG(Connection) << "received CNXN: version=" << p->msg.arg0 << ", maxdata = " << p->msg.arg1
+ << ", banner = '" << banner << "'";
+
if (t->use_tls) {
// We still handshake in TLS mode. If auth_required is disabled,
// we'll just not verify the client's certificate. This should be the