Fix multi-line log events display in web console

This commit is contained in:
shortcutme 2020-01-22 16:33:54 +01:00
parent 2b7aebd89d
commit e75e199334
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 8 additions and 1 deletions

View File

@ -58,9 +58,16 @@ class UiWebsocketPlugin(object):
assert SafeRe.isSafePattern(filter)
filter_re = re.compile(".*" + filter)
last_match = False
for line in log_file:
if filter and not filter_re.match(line):
if not line.startswith("[") and last_match: # Multi-line log entry
lines.append(line.replace(" ", " "))
continue
if filter and not filter_re.match(line):
last_match = False
continue
last_match = True
lines.append(line)
num_found = len(lines)