Fix case where S6 timestamp is missing

This commit is contained in:
Nicolas Mowen 2024-06-18 06:49:46 -06:00
parent 5b60785cca
commit a81c990e45

View File

@ -481,9 +481,13 @@ def logs(service: str):
for rawLine in contents.splitlines():
cleanLine = rawLine.strip()
if len(cleanLine) < 10 or " " not in cleanLine:
if len(cleanLine) < 10:
continue
# handle cases where S6 does not include date in log line
if " " not in cleanLine:
cleanLine = f"{datetime.now()} {cleanLine}"
if dateEnd == 0:
dateEnd = cleanLine.index(" ")
keyLength = dateEnd - (6 if service_location == "frigate" else 0)