From 4354c875088ac413824ad881505676de417e19bf Mon Sep 17 00:00:00 2001 From: kaliko Date: Sat, 24 Oct 2015 11:59:19 +0200 Subject: [PATCH] Some better logging messages to debug uniq bug --- sima/client.py | 2 ++ sima/core.py | 2 +- sima/launch.py | 2 +- sima/plugins/core/uniq.py | 8 ++++++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sima/client.py b/sima/client.py index 79843e0..8d40eda 100644 --- a/sima/client.py +++ b/sima/client.py @@ -411,6 +411,8 @@ class PlayerClient(Player): self.log.info(self._client.tagtypes()) self.log.warning('Disabling MusicBrainzIdentifier') Artist.use_mbid = False + else: + self.log.trace('Available metadata: %s', self._client.tagtypes()) else: self.log.warning('Use of MusicBrainzIdentifier disabled!') self.log.info('Consider using MusicBrainzIdentifier for your music library') diff --git a/sima/core.py b/sima/core.py index 8519e5d..2ffb04c 100644 --- a/sima/core.py +++ b/sima/core.py @@ -73,10 +73,10 @@ class Sima(Daemon): def foreach_plugin(self, method, *args, **kwds): """Plugin's callbacks dispatcher""" + self.log.trace('dispatching %s to plugins', method) for plugin in self.core_plugins: getattr(plugin, method)(*args, **kwds) for plugin in self.plugins: - #self.log.debug('dispatching {0} to {1}'.format(method, plugin)) getattr(plugin, method)(*args, **kwds) @property diff --git a/sima/launch.py b/sima/launch.py index 21d2e55..e29fe28 100644 --- a/sima/launch.py +++ b/sima/launch.py @@ -102,7 +102,7 @@ def start(sopt, restart=False): config.write(sys.stdout, space_around_delimiters=True) sys.exit(0) - logger.info('Starting...') + logger.info('Starting (%s)...', info.__version__) sima = core.Sima(config) # required core plugins diff --git a/sima/plugins/core/uniq.py b/sima/plugins/core/uniq.py index 0f42718..db2caff 100644 --- a/sima/plugins/core/uniq.py +++ b/sima/plugins/core/uniq.py @@ -30,6 +30,7 @@ from socket import getfqdn # third parties components # local import +from ...client import PlayerError from ...lib.plugin import Plugin @@ -71,8 +72,11 @@ class Uniq(Plugin): def sub_chan(self): self.log.debug('Registering as {}'.format(self.chan)) - self.player.subscribe(self.chan) - self._registred = True + try: + self.player.subscribe(self.chan) + self._registred = True + except PlayerError as err: + self.log.error('Failed to register: %s', err) def callback_need_track(self): if self.is_capable(): -- 2.39.5