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 = []
for i in log_lines:
try:
i = helpers.latinToAscii(i)
log_time = i.split(' [')[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]
clean_lines.append(full_line)
except:

View file

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