From: kaliko Date: Sat, 24 Oct 2015 09:59:19 +0000 (+0200) Subject: Some better logging messages to debug uniq bug X-Git-Tag: 0.14.1~12 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=4354c875088ac413824ad881505676de417e19bf;p=mpd-sima.git Some better logging messages to debug uniq bug --- 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():