Make log levels more appropriate and change warn to warnings

This commit is contained in:
TrueTechy 2019-10-02 01:59:25 +01:00
parent 4c3732c517
commit 7bffbc98b5
12 changed files with 36 additions and 36 deletions

View File

@ -279,7 +279,7 @@ def reset_kodi():
if name != 'version':
musicdb.cursor.execute("DELETE FROM " + name)
LOG.warn("[ reset kodi ]")
LOG.info("[ reset kodi ]")
def reset_jellyfin():
@ -296,7 +296,7 @@ def reset_jellyfin():
jellyfindb.cursor.execute("DROP table IF EXISTS view")
jellyfindb.cursor.execute("DROP table IF EXISTS version")
LOG.warn("[ reset jellyfin ]")
LOG.info("[ reset jellyfin ]")
def reset_artwork():
@ -323,7 +323,7 @@ def reset_artwork():
if name != 'version':
texdb.cursor.execute("DELETE FROM " + name)
LOG.warn("[ reset artwork ]")
LOG.info("[ reset artwork ]")
def get_sync():

View File

@ -26,7 +26,7 @@ def get_jellyfinserver_url(handler):
if handler.startswith('/'):
handler = handler[1:]
LOG.warn("handler starts with /: %s", handler)
LOG.info("handler starts with /: %s", handler)
return "{server}/emby/%s" % handler

View File

@ -51,7 +51,7 @@ class Events(object):
if server == 'None':
server = None
LOG.warn("path: %s params: %s", path, json.dumps(params, indent=4))
LOG.info("path: %s params: %s", path, json.dumps(params, indent=4))
if '/extrafanart' in base_url:

View File

@ -60,13 +60,13 @@ class Service(xbmc.Monitor):
if self.settings['enable_context_transcode']:
window('jellyfin_context_transcode.bool', True)
LOG.warn("--->>>[ %s ]", client.get_addon_name())
LOG.warn("Version: %s", client.get_version())
LOG.warn("KODI Version: %s", xbmc.getInfoLabel('System.BuildVersion'))
LOG.warn("Platform: %s", settings('platformDetected'))
LOG.warn("Python Version: %s", sys.version)
LOG.warn("Using dynamic paths: %s", settings('useDirectPaths') == "0")
LOG.warn("Log Level: %s", self.settings['log_level'])
LOG.info("--->>>[ %s ]", client.get_addon_name())
LOG.info("Version: %s", client.get_version())
LOG.info("KODI Version: %s", xbmc.getInfoLabel('System.BuildVersion'))
LOG.info("Platform: %s", settings('platformDetected'))
LOG.info("Python Version: %s", sys.version)
LOG.info("Using dynamic paths: %s", settings('useDirectPaths') == "0")
LOG.info("Log Level: %s", self.settings['log_level'])
self.check_version()
verify_kodi_defaults()
@ -161,7 +161,7 @@ class Service(xbmc.Monitor):
if not resp:
LOG.warn("Database version is out of date! USER IGNORED!")
LOG.warning("Database version is out of date! USER IGNORED!")
dialog("ok", heading=_('addon_name'), line1=_(33023))
raise Exception("User backed out of a required database reset")
@ -347,7 +347,7 @@ class Service(xbmc.Monitor):
elif method == 'System.OnWake':
if not self.monitor.sleep:
LOG.warn("System.OnSleep was never called, skip System.OnWake")
LOG.warning("System.OnSleep was never called, skip System.OnWake")
return
@ -386,24 +386,24 @@ class Service(xbmc.Monitor):
log_level = settings('logLevel')
window('jellyfin_logLevel', str(log_level))
self.settings['logLevel'] = log_level
LOG.warn("New log level: %s", log_level)
LOG.info("New log level: %s", log_level)
if settings('enableContext.bool') != self.settings['enable_context']:
window('jellyfin_context', settings('enableContext'))
self.settings['enable_context'] = settings('enableContext.bool')
LOG.warn("New context setting: %s", self.settings['enable_context'])
LOG.info("New context setting: %s", self.settings['enable_context'])
if settings('enableContextTranscode.bool') != self.settings['enable_context_transcode']:
window('jellyfin_context_transcode', settings('enableContextTranscode'))
self.settings['enable_context_transcode'] = settings('enableContextTranscode.bool')
LOG.warn("New context transcode setting: %s", self.settings['enable_context_transcode'])
LOG.info("New context transcode setting: %s", self.settings['enable_context_transcode'])
if settings('useDirectPaths') != self.settings['mode'] and self.library_thread.started:
self.settings['mode'] = settings('useDirectPaths')
LOG.warn("New playback mode setting: %s", self.settings['mode'])
LOG.info("New playback mode setting: %s", self.settings['mode'])
if not self.settings.get('mode_warn'):
@ -437,11 +437,11 @@ class Service(xbmc.Monitor):
objects.obj.Objects().mapping()
LOG.warn("---[ objects reloaded ]")
LOG.info("---[ objects reloaded ]")
def shutdown(self):
LOG.warn("---<[ EXITING ]")
LOG.info("---<[ EXITING ]")
window('jellyfin_should_stop.bool', True)
properties = [ # TODO: review
@ -464,4 +464,4 @@ class Service(xbmc.Monitor):
self.monitor.listener.stop()
self.monitor.webservice.stop()
LOG.warn("---<<<[ %s ]", client.get_addon_name())
LOG.info("---<<<[ %s ]", client.get_addon_name())

View File

@ -119,7 +119,7 @@ def advanced_settings():
if cleanonupdate is not None and cleanonupdate.text == "true":
LOG.warn("cleanonupdate disabled")
LOG.warning("cleanonupdate disabled")
video.remove(cleanonupdate)
indent(xml)

View File

@ -327,7 +327,7 @@ class ConnectionManager(object):
return self._test_next_connection_mode(tests, index + 1, server, options)
else:
if self._compare_versions(self._get_min_server_version(), result['Version']) == 1:
LOG.warn("minServerVersion requirement not met. Server version: %s", result['Version'])
LOG.warning("minServerVersion requirement not met. Server version: %s", result['Version'])
return {
'State': CONNECTION_STATE['ServerUpdateNeeded'],
'Servers': [server]

View File

@ -40,7 +40,7 @@ class Credentials(object):
raise ValueError("invalid credentials format")
except Exception as e: # File is either empty or missing
LOG.warn(e)
LOG.warning(e)
self.credentials = {}
LOG.debug("credentials initialized with: %s", self.credentials)

View File

@ -40,10 +40,10 @@ class HTTP(object):
return
try:
LOG.warn("--<[ session/%s ]", id(self.session))
LOG.info("--<[ session/%s ]", id(self.session))
self.session.close()
except Exception as error:
LOG.warn("The requests session could not be terminated: %s", error)
LOG.warning("The requests session could not be terminated: %s", error)
def _replace_user_info(self, string):

View File

@ -96,7 +96,7 @@ class Library(threading.Thread):
def run(self):
LOG.warn("--->[ library ]")
LOG.info("--->[ library ]")
if not self.startup():
self.stop_client()
@ -117,7 +117,7 @@ class Library(threading.Thread):
if self.monitor.waitForAbort(2):
break
LOG.warn("---<[ library ]")
LOG.info("---<[ library ]")
def test_databases(self):
@ -420,7 +420,7 @@ class Library(threading.Thread):
''' Inverse yes no, in case the dialog is forced closed by Kodi.
'''
if dialog("yesno", heading="{jellyfin}", line1=_(33172).replace('{number}', str(total)), nolabel=_(107), yeslabel=_(106)):
LOG.warn("Large updates skipped.")
LOG.warning("Large updates skipped.")
return True

View File

@ -448,7 +448,7 @@ class Listener(threading.Thread):
''' Detect the resume dialog for widgets.
Detect external players.
'''
LOG.warn("--->[ listener ]")
LOG.info("--->[ listener ]")
while not self.stop_thread:
special_listener()
@ -457,7 +457,7 @@ class Listener(threading.Thread):
# Abort was requested while waiting. We should exit
break
LOG.warn("---<[ listener ]")
LOG.info("---<[ listener ]")
def stop(self):
self.stop_thread = True

View File

@ -247,7 +247,7 @@ class Player(xbmc.Player):
try:
next_item = next_items['Items'][index + 1]
except IndexError:
LOG.warn("No next up episode.")
LOG.warning("No next up episode.")
return

View File

@ -68,13 +68,13 @@ class ServiceManager(threading.Thread):
if __name__ == "__main__":
LOG.warn("-->[ service ]")
LOG.warn("Delay startup by %s seconds.", DELAY)
LOG.info("-->[ service ]")
LOG.info("Delay startup by %s seconds.", DELAY)
while True:
if not settings('enableAddon.bool'):
LOG.warn("Jellyfin for Kodi is not enabled.")
LOG.warning("Jellyfin for Kodi is not enabled.")
break
@ -93,4 +93,4 @@ if __name__ == "__main__":
break
LOG.warn("--<[ service ]")
LOG.info("--<[ service ]")