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!! # Because Kodi appears to cache file settings!!
if clientId != "" and reset is False: if clientId != "" and reset is False:
window('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 return clientId
log.warn("Generating a new deviceid.") log.info("Generating a new deviceid.")
from uuid import uuid4 from uuid import uuid4
clientId = str(uuid4()) clientId = str(uuid4())
settings('plex_client_Id', value=clientId) settings('plex_client_Id', value=clientId)
window('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 return clientId

View file

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

View file

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