kopia lustrzana https://github.com/piku/piku
Handle strange characters in NodeJS log files
rodzic
d6bd43635a
commit
0cd70300d3
4
piku.py
4
piku.py
|
@ -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:
|
||||
|
|
Ładowanie…
Reference in New Issue