From 339eaaa13af3a39930b1a373fc8898387cb6a708 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sun, 4 Sep 2016 16:57:06 +0200 Subject: [PATCH] Fix log errors --- resources/lib/entrypoint.py | 2 +- resources/lib/initialsetup.py | 2 +- resources/lib/itemtypes.py | 2 +- resources/lib/kodimonitor.py | 10 +++++----- resources/lib/librarysync.py | 3 +-- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index 2e5c45c7..e1397ce7 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -41,7 +41,7 @@ def plexCompanion(fullurl, params): log.error("Command was not for us, machineIdentifier controller: %s, " "our machineIdentifier : %s" % (params['machineIdentifier'], - window('plex_machineIdentifier')), -1) + window('plex_machineIdentifier'))) return library, key, query = PlexFunctions.ParseContainerKey( diff --git a/resources/lib/initialsetup.py b/resources/lib/initialsetup.py index 3396ddc6..176b5006 100644 --- a/resources/lib/initialsetup.py +++ b/resources/lib/initialsetup.py @@ -374,7 +374,7 @@ class InitialSetup(): log.debug("Writing to Kodi user settings file") log.debug("PMS machineIdentifier: %s, ip: %s, port: %s, https: %s " % (server['machineIdentifier'], server['ip'], - server['port'], server['scheme']), 0) + server['port'], server['scheme'])) def setup(self): """ diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 326c9e2b..5d1a582f 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -866,7 +866,7 @@ class TVShows(Items): # try: # showid = show[0] # except TypeError: - # self.logMsg("Skipping: %s. Unable to add series: %s." % (itemid, seriesId), -1) + # log.error("Skipping: %s. Unable to add series: %s." % (itemid, seriesId)) log.error("Parent tvshow now found, skip item") return False seasonid = self.kodi_db.addSeason(showid, season) diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 8c5dfc3c..27733b13 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -48,7 +48,7 @@ class KodiMonitor(xbmc.Monitor): '''currentPath = settings('useDirectPaths') if window('plex_pluginpath') != currentPath: # Plugin path value changed. Offer to reset - self.logMsg("Changed to playback mode detected", 1) + log.info("Changed to playback mode detected") window('plex_pluginpath', value=currentPath) resp = xbmcgui.Dialog().yesno( heading="Playback mode change detected", @@ -119,7 +119,7 @@ class KodiMonitor(xbmc.Monitor): kodiid = data['id'] type = data['type'] except (KeyError, TypeError): - self.logMsg("Item is invalid for emby deletion.", 1) + log.info("Item is invalid for emby deletion.") else: # Send the delete action to the server. embyconn = utils.kodiSQL('emby') @@ -129,19 +129,19 @@ class KodiMonitor(xbmc.Monitor): try: itemid = emby_dbitem[0] except TypeError: - self.logMsg("Could not find itemid in emby database.", 1) + log.info("Could not find itemid in emby database.") else: if settings('skipContextMenu') != "true": resp = xbmcgui.Dialog().yesno( heading="Confirm delete", line1="Delete file on Emby Server?") if not resp: - self.logMsg("User skipped deletion.", 1) + log.info("User skipped deletion.") embycursor.close() return url = "{server}/emby/Items/%s?format=json" % itemid - self.logMsg("Deleting request: %s" % itemid) + log.info("Deleting request: %s" % itemid) doUtils.downloadUrl(url, action_type="DELETE") finally: embycursor.close()''' diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index 8003ef85..77fd88d9 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -1489,8 +1489,7 @@ class LibrarySync(Thread): self.run_internal() except Exception as e: window('plex_dbScan', clear=True) - log.error('LibrarySync thread crashed') - self.logMsg('Error message: %s' % e, -1) + log.error('LibrarySync thread crashed. Error message: %s' % e) import traceback log.error("Traceback:\n%s" % traceback.format_exc()) # Library sync thread has crashed