diff --git a/tuhi/config.py b/tuhi/config.py index 0a7ff61..827a0a2 100644 --- a/tuhi/config.py +++ b/tuhi/config.py @@ -44,6 +44,13 @@ class TuhiConfig(GObject.Object): self.peek_at_drawing = False return cls._instance + @property + def log_dir(self): + ''' + The pathlib.Path to the directory to store log files in. + ''' + return Path(self._base_path) + @GObject.Property def devices(self): ''' diff --git a/tuhi/wacom.py b/tuhi/wacom.py index 46fe091..2a84dcf 100644 --- a/tuhi/wacom.py +++ b/tuhi/wacom.py @@ -169,12 +169,10 @@ class DataLogger(object): } def __init__(self, bluez_device): - import xdg.BaseDirectory - self.logger = logging.getLogger('tuhi.fw') self.device = bluez_device self.btaddr = bluez_device.address - self.logdir = Path(xdg.BaseDirectory.xdg_data_home, 'tuhi', self.btaddr, 'raw') + self.logdir = Path(TuhiConfig().log_dir, self.btaddr, 'raw') self.logdir.mkdir(parents=True, exist_ok=True) bluez_device.connect('connected', self._on_bluez_connected)