Added logging support
This commit is contained in:
parent
0ff1af3ee4
commit
a411b53689
1 changed files with 4 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
import os
|
import os
|
||||||
|
import logging
|
||||||
|
|
||||||
import dbus
|
import dbus
|
||||||
|
|
||||||
|
|
@ -27,6 +28,7 @@ class Controller():
|
||||||
def __init__(self, bluetooth, controller_type):
|
def __init__(self, bluetooth, controller_type):
|
||||||
|
|
||||||
self.bt = bluetooth
|
self.bt = bluetooth
|
||||||
|
self.logger = logging.getLogger('nxbt')
|
||||||
|
|
||||||
if controller_type not in self.ALIASES.keys():
|
if controller_type not in self.ALIASES.keys():
|
||||||
raise ValueError("Unknown controller type specified")
|
raise ValueError("Unknown controller type specified")
|
||||||
|
|
@ -63,5 +65,5 @@ class Controller():
|
||||||
# catch the error and continue
|
# catch the error and continue
|
||||||
try:
|
try:
|
||||||
self.bt.register_profile(self.SDP_RECORD_PATH, self.SDP_UUID, opts)
|
self.bt.register_profile(self.SDP_RECORD_PATH, self.SDP_UUID, opts)
|
||||||
except dbus.exceptions.DBusException:
|
except dbus.exceptions.DBusException as e:
|
||||||
pass
|
self.logger.debug(e)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue