Lower maxnum of channel lines for web display
This commit is contained in:
parent
a4d34358fe
commit
d6ddbd5704
1 changed files with 7 additions and 4 deletions
|
|
@ -912,7 +912,7 @@ class ChannelDetailView(ChannelMixin, ObjectDetailView):
|
||||||
attributes = ["name"]
|
attributes = ["name"]
|
||||||
|
|
||||||
# How many log entries to read and display.
|
# How many log entries to read and display.
|
||||||
max_num_lines = 10000
|
max_num_lines = 1000
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|
@ -936,9 +936,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 line
|
||||||
|
continue
|
||||||
bucket.append({"key": time_key, "timestamp": time, "message": msg})
|
bucket.append({"key": time_key, "timestamp": time, "message": msg})
|
||||||
|
|
||||||
# Add the processed entries to the context
|
# Add the processed entries to the context
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue