mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-13 21:56: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)
|
log.warn(e)
|
||||||
self.credentials = {}
|
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', [])
|
self.credentials['Servers'] = self.credentials.setdefault('Servers', [])
|
||||||
|
|
||||||
def _get(self):
|
def _get(self):
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
import logging
|
import logging
|
||||||
import xbmc
|
import xbmc
|
||||||
|
|
||||||
from utils import window
|
from utils import window, settings
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
@ -27,10 +27,13 @@ class LogHandler(logging.StreamHandler):
|
||||||
def emit(self, record):
|
def emit(self, record):
|
||||||
|
|
||||||
if self._get_log_level(record.levelno):
|
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:
|
try:
|
||||||
xbmc.log(self.format(record), level=xbmc.LOGNOTICE)
|
xbmc.log(string, level=xbmc.LOGNOTICE)
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
xbmc.log(self.format(record).encode('utf-8'), level=xbmc.LOGNOTICE)
|
xbmc.log(string.encode('utf-8'), level=xbmc.LOGNOTICE)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_log_level(cls, level):
|
def _get_log_level(cls, level):
|
||||||
|
|
Loading…
Reference in a new issue