Skip to content

Commit b1a0a34

Browse files
committed
Change log name to be similar to ulog file names.
1 parent 9c9ab31 commit b1a0a34

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

can_testbench.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,15 +1622,13 @@ def initTabs(self, tabWidget: QTabWidget):
16221622
tabWidget.setTabWhatsThis(tabWidget.count() - 1 , self.channel)
16231623

16241624
def initLogFile(self):
1625-
counter = 1
16261625
scriptDir = path.dirname(path.abspath(__file__))
16271626
logDir = path.join(scriptDir, 'logs/')
16281627
dbcName = sanitizeFileName(os.path.basename(self.config.dbcFile))
1629-
logName = path.join(logDir, f"logfile_{datetime.datetime.now().date()}_{dbcName}")
1628+
timeStr = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
1629+
logName = path.join(logDir, f"log_{timeStr}")
16301630
logType = "log"
1631-
while os.path.isfile(f"{logName}_{counter:02}.{logType}"):
1632-
counter += 1
1633-
self.logFile = f"{logName}_{counter:02}.{logType}"
1631+
self.logFile = f"{logName}.{logType}"
16341632

16351633
def shutdown(self):
16361634
super().shutdown()

0 commit comments

Comments
 (0)