mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Resolve merge conflicts
This commit is contained in:
commit
8e382d9383
2 changed files with 16 additions and 3 deletions
|
|
@ -408,7 +408,16 @@ class EvenniaLogFile(logfile.LogFile):
|
|||
lines (list): lines from our _file attribute.
|
||||
|
||||
"""
|
||||
return [line.decode("utf-8") for line in self._file.readlines(*args, **kwargs)]
|
||||
lines = []
|
||||
for line in self._file.readlines(*args, **kwargs):
|
||||
try:
|
||||
lines.append(line.decode("utf-8"))
|
||||
except UnicodeDecodeError:
|
||||
try:
|
||||
lines.append(str(line))
|
||||
except Exception:
|
||||
lines.append("")
|
||||
return lines
|
||||
|
||||
|
||||
_LOG_FILE_HANDLES = {} # holds open log handles
|
||||
|
|
|
|||
|
|
@ -133,8 +133,12 @@ class ChannelDetailView(ChannelMixin, ObjectDetailView):
|
|||
for log in (x.strip() for x in tail_log_file(filename, 0, self.max_num_lines)):
|
||||
if not log:
|
||||
continue
|
||||
time, msg = log.split(" [-] ")
|
||||
time_key = time.split(":")[0]
|
||||
try:
|
||||
time, msg = log.split(" [-] ")
|
||||
time_key = time.split(":")[0]
|
||||
except ValueError:
|
||||
# malformed log line. Skip.
|
||||
continue
|
||||
|
||||
bucket.append({"key": time_key, "timestamp": time, "message": msg})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue