mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 09:46:11 +00:00
Mask api/server in logs
This commit is contained in:
parent
8fd8d90681
commit
a33d97a2fd
2 changed files with 7 additions and 4 deletions
|
@ -43,7 +43,7 @@ class Credentials(object):
|
|||
log.warn(e)
|
||||
self.credentials = {}
|
||||
|
||||
log.info("credentials initialized with: %s" % self.credentials)
|
||||
log.debug("credentials initialized with: %s" % self.credentials)
|
||||
self.credentials['Servers'] = self.credentials.setdefault('Servers', [])
|
||||
|
||||
def _get(self):
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
import logging
|
||||
import xbmc
|
||||
|
||||
from utils import window
|
||||
from utils import window, settings
|
||||
|
||||
##################################################################################################
|
||||
|
||||
|
@ -27,10 +27,13 @@ class LogHandler(logging.StreamHandler):
|
|||
def emit(self, record):
|
||||
|
||||
if self._get_log_level(record.levelno):
|
||||
string = self.format(record)
|
||||
string = string.replace(settings('server') or "{server}", "{emby-server}")
|
||||
string = string.replace(settings('token') or "{token}", "{emby-token}")
|
||||
try:
|
||||
xbmc.log(self.format(record), level=xbmc.LOGNOTICE)
|
||||
xbmc.log(string, level=xbmc.LOGNOTICE)
|
||||
except UnicodeEncodeError:
|
||||
xbmc.log(self.format(record).encode('utf-8'), level=xbmc.LOGNOTICE)
|
||||
xbmc.log(string.encode('utf-8'), level=xbmc.LOGNOTICE)
|
||||
|
||||
@classmethod
|
||||
def _get_log_level(cls, level):
|
||||
|
|
Loading…
Reference in a new issue