From bf3842c150f55d4f7dd5ad8e38b57d8a6cbda8ac Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 24 Jan 2018 20:20:03 +1000 Subject: [PATCH] wacom: use a different logger for the firmware communication This makes it easier to grep for the raw communication with the device. Fixes #28 --- tuhi/wacom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tuhi/wacom.py b/tuhi/wacom.py index 0f007f5..840b207 100644 --- a/tuhi/wacom.py +++ b/tuhi/wacom.py @@ -137,7 +137,7 @@ class WacomDevice(GObject.Object): self.height = WACOM_SLATE_HEIGHT self.name = device.name self._uuid = uuid - + self.fw_logger = logging.getLogger('tuhi.fw') self._is_running = False device.connect_gatt_value(WACOM_CHRC_LIVE_PEN_DATA_UUID, @@ -198,17 +198,17 @@ class WacomDevice(GObject.Object): data = data[6:] def _on_pen_data_received(self, name, data): - logger.debug(f"received pen data: {data}") + self.fw_logger.debug(f"RX Pen <-- {list2hex(data)}") self.pen_data_buffer.extend(data) def _on_nordic_data_received(self, name, value): - logger.debug(f"received nordic data: {value}") + self.fw_logger.debug(f"RX Nordic <-- {list2hex(value)}") self.nordic_answer = value def send_nordic_command(self, command, arguments): chrc = self.device.characteristics[NORDIC_UART_CHRC_TX_UUID] data = [command, len(arguments), *arguments] - logger.debug(f'sending {command:02x} / {len(arguments):02x} / {list2hex(arguments)}') + self.fw_logger.debug(f'TX Nordic --> {command:02x} / {len(arguments):02x} / {list2hex(arguments)}') chrc.write_value(data) def check_nordic_incoming(self):