Store the raw logs in the specified config dir too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
d514aa2224
commit
cdb7f905ca
|
@ -44,6 +44,13 @@ class TuhiConfig(GObject.Object):
|
||||||
self.peek_at_drawing = False
|
self.peek_at_drawing = False
|
||||||
return cls._instance
|
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
|
@GObject.Property
|
||||||
def devices(self):
|
def devices(self):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -169,12 +169,10 @@ class DataLogger(object):
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, bluez_device):
|
def __init__(self, bluez_device):
|
||||||
import xdg.BaseDirectory
|
|
||||||
|
|
||||||
self.logger = logging.getLogger('tuhi.fw')
|
self.logger = logging.getLogger('tuhi.fw')
|
||||||
self.device = bluez_device
|
self.device = bluez_device
|
||||||
self.btaddr = bluez_device.address
|
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)
|
self.logdir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
bluez_device.connect('connected', self._on_bluez_connected)
|
bluez_device.connect('connected', self._on_bluez_connected)
|
||||||
|
|
Loading…
Reference in New Issue