From a411b53689fec73297693b78613267022cdc0e9b Mon Sep 17 00:00:00 2001 From: Brikwerk Date: Tue, 7 Sep 2021 16:44:49 -0700 Subject: [PATCH] Added logging support --- nxbt/controller/controller.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nxbt/controller/controller.py b/nxbt/controller/controller.py index c895dea..f945608 100644 --- a/nxbt/controller/controller.py +++ b/nxbt/controller/controller.py @@ -1,5 +1,6 @@ from enum import Enum import os +import logging import dbus @@ -27,6 +28,7 @@ class Controller(): def __init__(self, bluetooth, controller_type): self.bt = bluetooth + self.logger = logging.getLogger('nxbt') if controller_type not in self.ALIASES.keys(): raise ValueError("Unknown controller type specified") @@ -63,5 +65,5 @@ class Controller(): # catch the error and continue try: self.bt.register_profile(self.SDP_RECORD_PATH, self.SDP_UUID, opts) - except dbus.exceptions.DBusException: - pass + except dbus.exceptions.DBusException as e: + self.logger.debug(e)