Fix logging for Python 3

This commit is contained in:
croneter 2020-12-18 19:32:28 +01:00
parent ac4b6fc7b5
commit f771b8d3aa

View file

@ -6,7 +6,7 @@ import xbmc
LEVELS = {
logging.ERROR: xbmc.LOGERROR,
logging.WARNING: xbmc.LOGWARNING,
logging.INFO: xbmc.LOGNOTICE,
logging.INFO: xbmc.LOGINFO,
logging.DEBUG: xbmc.LOGDEBUG
}
###############################################################################
@ -37,7 +37,7 @@ def config():
class LogHandler(logging.StreamHandler):
def __init__(self):
logging.StreamHandler.__init__(self)
self.setFormatter(logging.Formatter(fmt=b"%(name)s: %(message)s"))
self.setFormatter(logging.Formatter(fmt='%(name)s: %(message)s'))
def emit(self, record):
if isinstance(record.msg, str):