Adjust log levels

This commit is contained in:
croneter 2017-09-06 13:39:44 +02:00
parent 32c43855f7
commit b0c62be75f
3 changed files with 28 additions and 28 deletions

View file

@ -68,13 +68,13 @@ def getDeviceId(reset=False):
# Because Kodi appears to cache file settings!!
if clientId != "" and reset is False:
window('plex_client_Id', value=clientId)
log.warn("Unique device Id plex_client_Id loaded: %s" % clientId)
log.info("Unique device Id plex_client_Id loaded: %s" % clientId)
return clientId
log.warn("Generating a new deviceid.")
log.info("Generating a new deviceid.")
from uuid import uuid4
clientId = str(uuid4())
settings('plex_client_Id', value=clientId)
window('plex_client_Id', value=clientId)
log.warn("Unique device Id plex_client_Id loaded: %s" % clientId)
log.info("Unique device Id plex_client_Id loaded: %s" % clientId)
return clientId

View file

@ -198,12 +198,12 @@ class DownloadUtils():
# THE EXCEPTIONS
except requests.exceptions.ConnectionError as e:
# Connection error
log.debug("Server unreachable at: %s" % url)
log.debug(e)
log.warn("Server unreachable at: %s" % url)
log.warn(e)
except requests.exceptions.Timeout as e:
log.debug("Server timeout at: %s" % url)
log.debug(e)
log.warn("Server timeout at: %s" % url)
log.warn(e)
except requests.exceptions.HTTPError as e:
log.warn('HTTP Error at %s' % url)
@ -300,21 +300,21 @@ class DownloadUtils():
# update
pass
else:
log.error("Unable to convert the response for: "
log.warn("Unable to convert the response for: "
"%s" % url)
log.info("Received headers were: %s" % r.headers)
log.info('Received text:')
log.info(r.text)
log.warn("Received headers were: %s" % r.headers)
log.warn('Received text:')
log.warn(r.text)
return True
elif r.status_code == 403:
# E.g. deleting a PMS item
log.error('PMS sent 403: Forbidden error for url %s' % url)
log.warn('PMS sent 403: Forbidden error for url %s' % url)
return None
else:
log.error('Unknown answer from PMS %s with status code %s. '
log.warn('Unknown answer from PMS %s with status code %s. '
'Message:' % (url, r.status_code))
r.encoding = 'utf-8'
log.info(r.text)
log.warn(r.text)
return True
# And now deal with the consequences of the exceptions

View file

@ -93,16 +93,16 @@ class Service():
value=settings('fetch_pms_item_number'))
# Initial logging
log.warn("======== START %s ========" % v.ADDON_NAME)
log.warn("Platform: %s" % v.PLATFORM)
log.warn("KODI Version: %s" % v.KODILONGVERSION)
log.warn("%s Version: %s" % (v.ADDON_NAME, v.ADDON_VERSION))
log.warn("Using plugin paths: %s"
log.info("======== START %s ========" % v.ADDON_NAME)
log.info("Platform: %s" % v.PLATFORM)
log.info("KODI Version: %s" % v.KODILONGVERSION)
log.info("%s Version: %s" % (v.ADDON_NAME, v.ADDON_VERSION))
log.info("Using plugin paths: %s"
% (settings('useDirectPaths') != "true"))
log.warn("Number of sync threads: %s"
log.info("Number of sync threads: %s"
% settings('syncThreadNumber'))
log.warn("Log Level: %s" % logLevel)
log.warn("Full sys.argv received: %s" % argv)
log.info("Log Level: %s" % logLevel)
log.info("Full sys.argv received: %s" % argv)
# Reset window props for profile switch
properties = [
@ -172,7 +172,7 @@ class Service():
if window('plex_kodiProfile') != kodiProfile:
# Profile change happened, terminate this thread and others
log.warn("Kodi profile was: %s and changed to: %s. "
log.info("Kodi profile was: %s and changed to: %s. "
"Terminating old PlexKodiConnect thread."
% (kodiProfile,
window('plex_kodiProfile')))
@ -331,7 +331,7 @@ class Service():
except:
pass
window('plex_service_started', clear=True)
log.warn("======== STOP %s ========" % v.ADDON_NAME)
log.info("======== STOP %s ========" % v.ADDON_NAME)
# Safety net - Kody starts PKC twice upon first installation!
@ -344,11 +344,11 @@ else:
# Delay option
delay = int(settings('startupDelay'))
log.warn("Delaying Plex startup by: %s sec..." % delay)
log.info("Delaying Plex startup by: %s sec..." % delay)
if exit:
log.error('PKC service.py already started - exiting this instance')
elif delay and Monitor().waitForAbort(delay):
# Start the service
log.warn("Abort requested while waiting. PKC not started.")
log.info("Abort requested while waiting. PKC not started.")
else:
Service().ServiceEntryPoint()