Fix unicode log errors

This commit is contained in:
JonnyWong16 2018-04-07 10:35:28 -07:00
parent ad61e23d92
commit c4fc94ea34
2 changed files with 4 additions and 5 deletions

View file

@ -43,10 +43,9 @@ def get_log_tail(window=20, parsed=True, log_type="server"):
clean_lines = [] clean_lines = []
for i in log_lines: for i in log_lines:
try: try:
i = helpers.latinToAscii(i)
log_time = i.split(' [')[0] log_time = i.split(' [')[0]
log_level = i.split('] ', 1)[1].split(' - ',1)[0] log_level = i.split('] ', 1)[1].split(' - ', 1)[0]
log_msg = i.split('] ', 1)[1].split(' - ',1)[1] log_msg = unicode(i.split('] ', 1)[1].split(' - ', 1)[1], 'utf-8')
full_line = [log_time, log_level, log_msg] full_line = [log_time, log_level, log_msg]
clean_lines.append(full_line) clean_lines.append(full_line)
except: except:

View file

@ -2316,8 +2316,8 @@ class WebInterface(object):
# Add traceback message to previous msg. # Add traceback message to previous msg.
tl = (len(filt) - 1) tl = (len(filt) - 1)
n = len(l) - len(l.lstrip(' ')) n = len(l) - len(l.lstrip(' '))
l = ' ' * (2 * n) + l[n:] ll = ' ' * (2 * n) + unicode(l[n:], 'utf-8')
filt[tl][2] += '<br>' + l filt[tl][2] += '<br>' + ll
continue continue
log_levels = ['DEBUG', 'INFO', 'WARNING', 'ERROR'] log_levels = ['DEBUG', 'INFO', 'WARNING', 'ERROR']