Skip to content

Commit

Permalink
update web log
Browse files Browse the repository at this point in the history
  • Loading branch information
misads committed Jul 6, 2021
1 parent 9bb3f96 commit a55c3d2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,12 @@ def parse_log(tag):
'<span style="color:#262420;">' + lines[i][pos_equ+1:] + '</span>'
elif config:
pos_equ = line.rfind(':')
lines[i] = f'<span style="color:{time_color};">' + lines[i][:26] + '</span>' + \
'<span style="color:#457ab2;">' + lines[i][26:pos_equ] + '</span>' + ':' + \
'<span style="color:#262420;">' + lines[i][pos_equ+1:] + '</span>'
if pos_equ > 26:
lines[i] = f'<span style="color:{time_color};">' + lines[i][:26] + '</span>' + \
'<span style="color:#457ab2;">' + lines[i][26:pos_equ] + '</span>' + ':' + \
'<span style="color:#262420;">' + lines[i][pos_equ+1:] + '</span>'
else:
lines[i] = ''

elif 'Eva(' in line:
lines[i] = f'<span style="color:{time_color};">' + lines[i][:26] + '</span><span style="color:#981e23;">' + lines[i][26:] + '</span>'
Expand Down Expand Up @@ -141,6 +144,7 @@ def parse_log(tag):

lines[i] = lines[i].replace(' ', ' ')

lines = filter(lambda x: x, lines)
log = '<br/>'.join(lines)

return log
Expand Down

0 comments on commit a55c3d2

Please sign in to comment.