Handle strange characters in NodeJS log files

pull/185/head
Rui Carmo 2020-03-15 17:05:14 +00:00 zatwierdzone przez GitHub
rodzic d6bd43635a
commit 0cd70300d3
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -969,7 +969,7 @@ def multi_tail(app, filenames, catch_up=20):
# Set up current state for each log file
for f in filenames:
prefixes[f] = splitext(basename(f))[0]
files[f] = open(f)
ffiles[f] = open(f, "rt", encoding="utf-8", errors="ignore")
inodes[f] = stat(f).st_ino
files[f].seek(0, 2)
@ -977,7 +977,7 @@ def multi_tail(app, filenames, catch_up=20):
# Grab a little history (if any)
for f in filenames:
for line in deque(open(f), catch_up):
for line in deque(open(f, "rt", encoding="utf-8", errors="ignore"), catch_up):
yield "{} | {}".format(prefixes[f].ljust(longest), line)
while True: