diff --git a/jellyfin_kodi/helper/loghandler.py b/jellyfin_kodi/helper/loghandler.py index 2d3ec659..0e8fabc7 100644 --- a/jellyfin_kodi/helper/loghandler.py +++ b/jellyfin_kodi/helper/loghandler.py @@ -61,10 +61,7 @@ class LogHandler(logging.StreamHandler): for token in self.sensitive['Token']: string = string.replace(token or "{token}", "{jellyfin-token}") - try: - xbmc.log(string, level=xbmc.LOGNOTICE) - except UnicodeEncodeError: - xbmc.log(string, level=xbmc.LOGNOTICE) + xbmc.log(string, level=xbmc.LOGNOTICE) @classmethod def _get_log_level(cls, level): @@ -85,27 +82,15 @@ class LogHandler(logging.StreamHandler): class MyFormatter(logging.Formatter): - def __init__(self, fmt="%(name)s -> %(message)s"): - + def __init__(self, fmt='%(name)s -> %(levelname)s::%(relpath)s:%(lineno)s %(message)s'): logging.Formatter.__init__(self, fmt) def format(self, record): - - # Save the original format configured by the user - # when the logger formatter was instantiated - format_orig = self._fmt - self._gen_rel_path(record) - # Replace the original format with one customized by logging level - self._fmt = '%(name)s -> %(levelname)s::%(relpath)s:%(lineno)s %(message)s' - # Call the original formatter class to do the grunt work result = logging.Formatter.format(self, record) - # Restore the original format configured by the user - self._fmt = format_orig - return result def formatException(self, exc_info):