fixet typo
This commit is contained in:
@@ -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 ()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user