From df2332b4e2f653a6c4e2450dbbeaeb51dcc0505f Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 3 Apr 2024 10:38:42 -0600 Subject: [PATCH] Fix log lines missing --- frigate/api/app.py | 6 ++++-- web/src/pages/Logs.tsx | 13 ++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/frigate/api/app.py b/frigate/api/app.py index c1f91c499..3900aac05 100644 --- a/frigate/api/app.py +++ b/frigate/api/app.py @@ -446,10 +446,12 @@ def logs(service: str): newKey = cleanLine[0:keyLength] if newKey == currentKey: - currentLine += f"{cleanLine[dateEnd:].strip()}\n" + currentLine += f"\n{cleanLine[dateEnd:].strip()}" continue else: - logLines.append(currentLine) + if len(currentLine) > 0: + logLines.append(currentLine) + currentKey = newKey currentLine = cleanLine diff --git a/web/src/pages/Logs.tsx b/web/src/pages/Logs.tsx index 99aaaafa3..0a7e05ae3 100644 --- a/web/src/pages/Logs.tsx +++ b/web/src/pages/Logs.tsx @@ -90,6 +90,17 @@ function Logs() { const match = frigateDateStamp.exec(line); if (!match) { + const infoIndex = line.indexOf("[INFO]"); + + if (infoIndex != -1) { + return { + dateStamp: line.substring(0, 19), + severity: "info", + section: "starutp", + content: line.substring(infoIndex + 6).trim(), + }; + } + return null; } @@ -340,7 +351,7 @@ function Logs() { {logLines.length > 0 && - [...Array(logRange.end - 1).keys()].map((idx) => { + [...Array(logRange.end).keys()].map((idx) => { const logLine = idx >= logRange.start ? logLines[idx - logRange.start]