fixet typo

This commit is contained in:
2018-09-25 20:49:00 +02:00
parent 7ed685e682
commit f2f82174b8

View File

@@ -33,6 +33,7 @@ class CanListener (can.Listener):
self.waitack = [0] * 128
self.waitackst = [0] * 128
self.loglevel = 9
self.log("Init Vars", 0)
@@ -45,11 +46,11 @@ class CanListener (can.Listener):
Logfile
Loglevel 9 = print to console
"""
dt = datetime.now ()
if self.loglevel == 9:
print ("%4d-%02d-%02d %02d:%02d:%02d.%06d: " %(dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.microsecond) + msg)
print ("%4d-%02d-%02d %02d:%02d:%02d.%06d: " %(dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.microsecond) + msg)
if _level <= self.loglevel:
file = open ("/var/log/lactor/" + os.getcwd().split('/')[-1] + '.err', "a")
dt = datetime.now ()
file.write ("%4d-%02d-%02d %02d:%02d:%02d.%06d: " %(dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.microsecond) + msg + "\n")
file.close ()