mirror of
https://github.com/FAUSheppy/skillbird
synced 2026-01-21 22:07:38 +01:00
[git fast commit] 10. Feb 2019 - 11:55:03
This commit is contained in:
@@ -190,7 +190,7 @@ def create_event(etype,line,timestamp):
|
||||
else:
|
||||
raise Exception("Cannot create event from logline. (etype was: '{}')".format(etype))
|
||||
|
||||
def parseDate(line):
|
||||
def parseDate(l):
|
||||
if ": L " in l.split("0x42")[0]:
|
||||
timestamp = datetime.strptime(l.split(": L ")[1].split(": [")[0],"%m/%d/%Y - %H:%M:%S")
|
||||
else:
|
||||
@@ -202,12 +202,12 @@ def parse_line_to_event(l):
|
||||
tmp = l.split("0x42,")[1].strip("\n")
|
||||
etype = tmp.split(",")[0].split("|")[0]
|
||||
try:
|
||||
timestamp = parseDate(l)
|
||||
event = create_event(etype,tmp,timestamp)
|
||||
timestamp = parseDate(line)
|
||||
except ValueError:
|
||||
print(" ---- NO TIME ---- | WARNING: Failed to parse time for event, SKIP")
|
||||
return None
|
||||
except Exception as e:
|
||||
except IndexError as e:
|
||||
print("Failed to parse Event in line, skipping: {}".format(str(e)))
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user