diff --git a/spacelab_transmitter/spacelabtransmitter.py b/spacelab_transmitter/spacelabtransmitter.py index 8dbf94e..d67b230 100644 --- a/spacelab_transmitter/spacelabtransmitter.py +++ b/spacelab_transmitter/spacelabtransmitter.py @@ -66,8 +66,8 @@ #Defining logfile deafult local _DIR_CONFIG_LOGFILE_LINUX = 'spacelab_transmitter' -_DEFAULT_LOGFILE_PATH = os.path.join(os.path.expanduser('~'), _DIR_CONFIG_LOGFILE_LINUX) -_DEFAULT_LOGFILE = 'logfile.csv' +_DEFAULT_LOGFILE_PATH = os.path.join(os.path.expanduser('~'), _DIR_CONFIG_LOGFILE_LINUX) +_DEFAULT_LOGFILE = 'logfile.csv' class SpaceLabTransmitter: @@ -212,14 +212,13 @@ def on_toolbutton_about_clicked(self, toolbutton): self.aboutdialog.hide() def write_log(self, msg): - timestamp = datetime.now() + event = [str(datetime.now()), msg] - self.listmodel_events.append([str(timestamp), msg]) + self.listmodel_events.append(event) if not os.path.exists(_DEFAULT_LOGFILE_PATH): os.mkdir(_DEFAULT_LOGFILE_PATH) with open(_DEFAULT_LOGFILE_PATH + '/' + _DEFAULT_LOGFILE, 'a') as logfile: writer = csv.writer(logfile, delimiter='\t') - writer.writerows(self.listmodel_events) - \ No newline at end of file + writer.writerow(event)