mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
Merge pull request #102 from TrueTechy/update-logging
Make log levels more appropriate and change warn to warnings
This commit is contained in:
commit
e74fac10be
12 changed files with 36 additions and 36 deletions
|
@ -279,7 +279,7 @@ def reset_kodi():
|
||||||
if name != 'version':
|
if name != 'version':
|
||||||
musicdb.cursor.execute("DELETE FROM " + name)
|
musicdb.cursor.execute("DELETE FROM " + name)
|
||||||
|
|
||||||
LOG.warn("[ reset kodi ]")
|
LOG.info("[ reset kodi ]")
|
||||||
|
|
||||||
def reset_jellyfin():
|
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 view")
|
||||||
jellyfindb.cursor.execute("DROP table IF EXISTS version")
|
jellyfindb.cursor.execute("DROP table IF EXISTS version")
|
||||||
|
|
||||||
LOG.warn("[ reset jellyfin ]")
|
LOG.info("[ reset jellyfin ]")
|
||||||
|
|
||||||
def reset_artwork():
|
def reset_artwork():
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ def reset_artwork():
|
||||||
if name != 'version':
|
if name != 'version':
|
||||||
texdb.cursor.execute("DELETE FROM " + name)
|
texdb.cursor.execute("DELETE FROM " + name)
|
||||||
|
|
||||||
LOG.warn("[ reset artwork ]")
|
LOG.info("[ reset artwork ]")
|
||||||
|
|
||||||
def get_sync():
|
def get_sync():
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ def get_jellyfinserver_url(handler):
|
||||||
if handler.startswith('/'):
|
if handler.startswith('/'):
|
||||||
|
|
||||||
handler = handler[1:]
|
handler = handler[1:]
|
||||||
LOG.warn("handler starts with /: %s", handler)
|
LOG.info("handler starts with /: %s", handler)
|
||||||
|
|
||||||
return "{server}/emby/%s" % handler
|
return "{server}/emby/%s" % handler
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ class Events(object):
|
||||||
if server == 'None':
|
if server == 'None':
|
||||||
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:
|
if '/extrafanart' in base_url:
|
||||||
|
|
||||||
|
|
|
@ -60,13 +60,13 @@ class Service(xbmc.Monitor):
|
||||||
if self.settings['enable_context_transcode']:
|
if self.settings['enable_context_transcode']:
|
||||||
window('jellyfin_context_transcode.bool', True)
|
window('jellyfin_context_transcode.bool', True)
|
||||||
|
|
||||||
LOG.warn("--->>>[ %s ]", client.get_addon_name())
|
LOG.info("--->>>[ %s ]", client.get_addon_name())
|
||||||
LOG.warn("Version: %s", client.get_version())
|
LOG.info("Version: %s", client.get_version())
|
||||||
LOG.warn("KODI Version: %s", xbmc.getInfoLabel('System.BuildVersion'))
|
LOG.info("KODI Version: %s", xbmc.getInfoLabel('System.BuildVersion'))
|
||||||
LOG.warn("Platform: %s", settings('platformDetected'))
|
LOG.info("Platform: %s", settings('platformDetected'))
|
||||||
LOG.warn("Python Version: %s", sys.version)
|
LOG.info("Python Version: %s", sys.version)
|
||||||
LOG.warn("Using dynamic paths: %s", settings('useDirectPaths') == "0")
|
LOG.info("Using dynamic paths: %s", settings('useDirectPaths') == "0")
|
||||||
LOG.warn("Log Level: %s", self.settings['log_level'])
|
LOG.info("Log Level: %s", self.settings['log_level'])
|
||||||
|
|
||||||
self.check_version()
|
self.check_version()
|
||||||
verify_kodi_defaults()
|
verify_kodi_defaults()
|
||||||
|
@ -161,7 +161,7 @@ class Service(xbmc.Monitor):
|
||||||
|
|
||||||
if not resp:
|
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))
|
dialog("ok", heading=_('addon_name'), line1=_(33023))
|
||||||
|
|
||||||
raise Exception("User backed out of a required database reset")
|
raise Exception("User backed out of a required database reset")
|
||||||
|
@ -347,7 +347,7 @@ class Service(xbmc.Monitor):
|
||||||
elif method == 'System.OnWake':
|
elif method == 'System.OnWake':
|
||||||
|
|
||||||
if not self.monitor.sleep:
|
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
|
return
|
||||||
|
|
||||||
|
@ -386,24 +386,24 @@ class Service(xbmc.Monitor):
|
||||||
log_level = settings('logLevel')
|
log_level = settings('logLevel')
|
||||||
window('jellyfin_logLevel', str(log_level))
|
window('jellyfin_logLevel', str(log_level))
|
||||||
self.settings['logLevel'] = 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']:
|
if settings('enableContext.bool') != self.settings['enable_context']:
|
||||||
|
|
||||||
window('jellyfin_context', settings('enableContext'))
|
window('jellyfin_context', settings('enableContext'))
|
||||||
self.settings['enable_context'] = settings('enableContext.bool')
|
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']:
|
if settings('enableContextTranscode.bool') != self.settings['enable_context_transcode']:
|
||||||
|
|
||||||
window('jellyfin_context_transcode', settings('enableContextTranscode'))
|
window('jellyfin_context_transcode', settings('enableContextTranscode'))
|
||||||
self.settings['enable_context_transcode'] = settings('enableContextTranscode.bool')
|
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:
|
if settings('useDirectPaths') != self.settings['mode'] and self.library_thread.started:
|
||||||
|
|
||||||
self.settings['mode'] = settings('useDirectPaths')
|
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'):
|
if not self.settings.get('mode_warn'):
|
||||||
|
|
||||||
|
@ -437,11 +437,11 @@ class Service(xbmc.Monitor):
|
||||||
|
|
||||||
objects.obj.Objects().mapping()
|
objects.obj.Objects().mapping()
|
||||||
|
|
||||||
LOG.warn("---[ objects reloaded ]")
|
LOG.info("---[ objects reloaded ]")
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
|
|
||||||
LOG.warn("---<[ EXITING ]")
|
LOG.info("---<[ EXITING ]")
|
||||||
window('jellyfin_should_stop.bool', True)
|
window('jellyfin_should_stop.bool', True)
|
||||||
|
|
||||||
properties = [ # TODO: review
|
properties = [ # TODO: review
|
||||||
|
@ -464,4 +464,4 @@ class Service(xbmc.Monitor):
|
||||||
self.monitor.listener.stop()
|
self.monitor.listener.stop()
|
||||||
self.monitor.webservice.stop()
|
self.monitor.webservice.stop()
|
||||||
|
|
||||||
LOG.warn("---<<<[ %s ]", client.get_addon_name())
|
LOG.info("---<<<[ %s ]", client.get_addon_name())
|
||||||
|
|
|
@ -119,7 +119,7 @@ def advanced_settings():
|
||||||
|
|
||||||
if cleanonupdate is not None and cleanonupdate.text == "true":
|
if cleanonupdate is not None and cleanonupdate.text == "true":
|
||||||
|
|
||||||
LOG.warn("cleanonupdate disabled")
|
LOG.warning("cleanonupdate disabled")
|
||||||
video.remove(cleanonupdate)
|
video.remove(cleanonupdate)
|
||||||
|
|
||||||
indent(xml)
|
indent(xml)
|
||||||
|
|
|
@ -327,7 +327,7 @@ class ConnectionManager(object):
|
||||||
return self._test_next_connection_mode(tests, index + 1, server, options)
|
return self._test_next_connection_mode(tests, index + 1, server, options)
|
||||||
else:
|
else:
|
||||||
if self._compare_versions(self._get_min_server_version(), result['Version']) == 1:
|
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 {
|
return {
|
||||||
'State': CONNECTION_STATE['ServerUpdateNeeded'],
|
'State': CONNECTION_STATE['ServerUpdateNeeded'],
|
||||||
'Servers': [server]
|
'Servers': [server]
|
||||||
|
|
|
@ -40,7 +40,7 @@ class Credentials(object):
|
||||||
raise ValueError("invalid credentials format")
|
raise ValueError("invalid credentials format")
|
||||||
|
|
||||||
except Exception as e: # File is either empty or missing
|
except Exception as e: # File is either empty or missing
|
||||||
LOG.warn(e)
|
LOG.warning(e)
|
||||||
self.credentials = {}
|
self.credentials = {}
|
||||||
|
|
||||||
LOG.debug("credentials initialized with: %s", self.credentials)
|
LOG.debug("credentials initialized with: %s", self.credentials)
|
||||||
|
|
|
@ -40,10 +40,10 @@ class HTTP(object):
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
LOG.warn("--<[ session/%s ]", id(self.session))
|
LOG.info("--<[ session/%s ]", id(self.session))
|
||||||
self.session.close()
|
self.session.close()
|
||||||
except Exception as error:
|
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):
|
def _replace_user_info(self, string):
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ class Library(threading.Thread):
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
LOG.warn("--->[ library ]")
|
LOG.info("--->[ library ]")
|
||||||
|
|
||||||
if not self.startup():
|
if not self.startup():
|
||||||
self.stop_client()
|
self.stop_client()
|
||||||
|
@ -117,7 +117,7 @@ class Library(threading.Thread):
|
||||||
if self.monitor.waitForAbort(2):
|
if self.monitor.waitForAbort(2):
|
||||||
break
|
break
|
||||||
|
|
||||||
LOG.warn("---<[ library ]")
|
LOG.info("---<[ library ]")
|
||||||
|
|
||||||
def test_databases(self):
|
def test_databases(self):
|
||||||
|
|
||||||
|
@ -420,7 +420,7 @@ class Library(threading.Thread):
|
||||||
''' Inverse yes no, in case the dialog is forced closed by Kodi.
|
''' 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)):
|
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
|
return True
|
||||||
|
|
||||||
|
|
|
@ -448,7 +448,7 @@ class Listener(threading.Thread):
|
||||||
''' Detect the resume dialog for widgets.
|
''' Detect the resume dialog for widgets.
|
||||||
Detect external players.
|
Detect external players.
|
||||||
'''
|
'''
|
||||||
LOG.warn("--->[ listener ]")
|
LOG.info("--->[ listener ]")
|
||||||
|
|
||||||
while not self.stop_thread:
|
while not self.stop_thread:
|
||||||
special_listener()
|
special_listener()
|
||||||
|
@ -457,7 +457,7 @@ class Listener(threading.Thread):
|
||||||
# Abort was requested while waiting. We should exit
|
# Abort was requested while waiting. We should exit
|
||||||
break
|
break
|
||||||
|
|
||||||
LOG.warn("---<[ listener ]")
|
LOG.info("---<[ listener ]")
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self.stop_thread = True
|
self.stop_thread = True
|
||||||
|
|
|
@ -247,7 +247,7 @@ class Player(xbmc.Player):
|
||||||
try:
|
try:
|
||||||
next_item = next_items['Items'][index + 1]
|
next_item = next_items['Items'][index + 1]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
LOG.warn("No next up episode.")
|
LOG.warning("No next up episode.")
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -68,13 +68,13 @@ class ServiceManager(threading.Thread):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
LOG.warn("-->[ service ]")
|
LOG.info("-->[ service ]")
|
||||||
LOG.warn("Delay startup by %s seconds.", DELAY)
|
LOG.info("Delay startup by %s seconds.", DELAY)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|
||||||
if not settings('enableAddon.bool'):
|
if not settings('enableAddon.bool'):
|
||||||
LOG.warn("Jellyfin for Kodi is not enabled.")
|
LOG.warning("Jellyfin for Kodi is not enabled.")
|
||||||
|
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -93,4 +93,4 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
break
|
break
|
||||||
|
|
||||||
LOG.warn("--<[ service ]")
|
LOG.info("--<[ service ]")
|
||||||
|
|
Loading…
Reference in a new issue