From 39dfa7ef720490edff13d5de0403c4083ab20cd3 Mon Sep 17 00:00:00 2001
From: Metin Kaya <metin.kaya@arm.com>
Date: Mon, 5 Feb 2024 10:11:35 +0000
Subject: [PATCH] utils/android: Add debug log about connection settings

While we are there, also fix a trivial pylint issue regarding string
format.

Signed-off-by: Metin Kaya <metin.kaya@arm.com>
---
 devlib/utils/android.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/devlib/utils/android.py b/devlib/utils/android.py
index 36f064a..6f2eb87 100755
--- a/devlib/utils/android.py
+++ b/devlib/utils/android.py
@@ -294,6 +294,10 @@ class AdbConnection(ConnectionBase):
             total_transfer_timeout=total_transfer_timeout,
             transfer_poll_period=transfer_poll_period,
         )
+
+        self.logger.debug('server=%s port=%s device=%s as_root=%s',
+                          adb_server, adb_port, device, adb_as_root)
+
         self.timeout = timeout if timeout is not None else self.default_timeout
         if device is None:
             device = adb_get_device(timeout=timeout, adb_server=adb_server, adb_port=adb_port)
@@ -545,9 +549,9 @@ def adb_connect(device, timeout=None, attempts=MAX_ATTEMPTS, adb_server=None, ad
             break
         time.sleep(10)
     else:  # did not connect to the device
-        message = 'Could not connect to {}'.format(device or 'a device')
+        message = f'Could not connect to {device or "a device"} at {adb_server}:{adb_port}'
         if output:
-            message += '; got: "{}"'.format(output)
+            message += f'; got: {output}'
         raise HostError(message)