Improve logging stability
This commit is contained in:
parent
bb96dda1d4
commit
f72e120cf5
1 changed files with 2 additions and 2 deletions
|
@ -5,7 +5,7 @@
|
||||||
import logging
|
import logging
|
||||||
import xbmc
|
import xbmc
|
||||||
|
|
||||||
from utils import window
|
from utils import window, tryEncode
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class LogHandler(logging.StreamHandler):
|
||||||
try:
|
try:
|
||||||
xbmc.log(self.format(record), level=xbmc.LOGNOTICE)
|
xbmc.log(self.format(record), level=xbmc.LOGNOTICE)
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
xbmc.log(self.format(record).encode('utf-8'), level=xbmc.LOGNOTICE)
|
xbmc.log(tryEncode(self.format(record)), level=xbmc.LOGNOTICE)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_log_level(cls, level):
|
def _get_log_level(cls, level):
|
||||||
|
|
Loading…
Reference in a new issue