From f72e120cf539a056e94dc43ed937a39d001b0d26 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Thu, 1 Sep 2016 19:09:51 +0200 Subject: [PATCH] Improve logging stability --- resources/lib/loghandler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lib/loghandler.py b/resources/lib/loghandler.py index 3ecef026..51c22aff 100644 --- a/resources/lib/loghandler.py +++ b/resources/lib/loghandler.py @@ -5,7 +5,7 @@ import logging import xbmc -from utils import window +from utils import window, tryEncode ################################################################################################## @@ -30,7 +30,7 @@ class LogHandler(logging.StreamHandler): try: xbmc.log(self.format(record), level=xbmc.LOGNOTICE) except UnicodeEncodeError: - xbmc.log(self.format(record).encode('utf-8'), level=xbmc.LOGNOTICE) + xbmc.log(tryEncode(self.format(record)), level=xbmc.LOGNOTICE) @classmethod def _get_log_level(cls, level):