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.
|
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
|
_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)):
|
for log in (x.strip() for x in tail_log_file(filename, 0, self.max_num_lines)):
|
||||||
if not log:
|
if not log:
|
||||||
continue
|
continue
|
||||||
time, msg = log.split(" [-] ")
|
try:
|
||||||
time_key = time.split(":")[0]
|
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})
|
bucket.append({"key": time_key, "timestamp": time, "message": msg})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue