From 114895c183b99df01b62560a01d8828863c3ecd8 Mon Sep 17 00:00:00 2001 From: Croneter Date: Wed, 30 May 2018 11:24:51 +0200 Subject: [PATCH] Fix logging --- resources/lib/PlexFunctions.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/resources/lib/PlexFunctions.py b/resources/lib/PlexFunctions.py index 8c60caf2..7a127659 100644 --- a/resources/lib/PlexFunctions.py +++ b/resources/lib/PlexFunctions.py @@ -206,7 +206,7 @@ def discover_pms(token=None): if token: LOG.info('Checking with plex.tv for more PMS to connect to') plex_pms_list = _pms_list_from_plex_tv(token) - LOG.debug('PMS found on plex.tv: %s', plex_pms_list) + _log_pms(plex_pms_list) else: LOG.info('No plex token supplied, only checked LAN for available PMS') plex_pms_list = [] @@ -231,13 +231,16 @@ def discover_pms(token=None): pms['ip'], pms['port']) plex_pms_list.append(pms) + _log_pms(plex_pms_list) + return plex_pms_list - log_list = deepcopy(plex_pms_list) + +def _log_pms(pms_list): + log_list = deepcopy(pms_list) for pms in log_list: if pms.get('token') is not None: pms['token'] = '%s...' % pms['token'][:5] - LOG.debug('Found the following PMS in total: %s', log_list) - return plex_pms_list + LOG.debug('Found the following PMS: %s', log_list) def _plex_gdm():