Fixed bug with log page not displaying if non-utf8 characters

This commit is contained in:
Remy
2011-08-10 05:49:25 +08:00
committed by sbuser
parent e70f893ff3
commit 2dd5ab94ee
6 changed files with 34 additions and 34 deletions

View File

@@ -15,23 +15,18 @@
<tbody>
%for line in lineList:
<%
out_tuple = helpers.extract_logline(line)
timestamp, message, level, threadname = line
if level == 'WARNING' or level == 'ERROR':
grade = 'X'
else:
grade = 'Z'
%>
%if out_tuple:
<%
if out_tuple[1] == 'DEBUG':
continue
elif out_tuple[1] == 'WARNING' or out_tuple[1] == 'ERROR':
grade = 'X'
else:
grade = 'Z'
%>
<tr class="grade${grade}">
<td id="timestamp">${out_tuple[0]}</td>
<td id="level">${out_tuple[1]}</td>
<td id="message">${out_tuple[3].decode('utf-8')}</td>
<td id="timestamp">${timestamp}</td>
<td id="level">${level}</td>
<td id="message">${message}</td>
</tr>
%endif
%endfor
</tbody>
</table>