Fix logging for Python 3
This commit is contained in:
parent
ac4b6fc7b5
commit
f771b8d3aa
1 changed files with 2 additions and 2 deletions
|
@ -6,7 +6,7 @@ import xbmc
|
||||||
LEVELS = {
|
LEVELS = {
|
||||||
logging.ERROR: xbmc.LOGERROR,
|
logging.ERROR: xbmc.LOGERROR,
|
||||||
logging.WARNING: xbmc.LOGWARNING,
|
logging.WARNING: xbmc.LOGWARNING,
|
||||||
logging.INFO: xbmc.LOGNOTICE,
|
logging.INFO: xbmc.LOGINFO,
|
||||||
logging.DEBUG: xbmc.LOGDEBUG
|
logging.DEBUG: xbmc.LOGDEBUG
|
||||||
}
|
}
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -37,7 +37,7 @@ def config():
|
||||||
class LogHandler(logging.StreamHandler):
|
class LogHandler(logging.StreamHandler):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
logging.StreamHandler.__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):
|
def emit(self, record):
|
||||||
if isinstance(record.msg, str):
|
if isinstance(record.msg, str):
|
||||||
|
|
Loading…
Reference in a new issue