From 2939307120af1b8729699f649b354ab2e47637ec Mon Sep 17 00:00:00 2001 From: schneefux Date: Fri, 26 Sep 2014 16:48:42 +0200 Subject: Improved logging in brain.py --- client/brain.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'client/brain.py') diff --git a/client/brain.py b/client/brain.py index 007b7fe..b4620c3 100644 --- a/client/brain.py +++ b/client/brain.py @@ -61,13 +61,15 @@ class Brain(object): """ for module in self.modules: for text in texts: - if module.isValid(text): + self._logger.debug("'%s' is a valid phrase for module '%s'", text, module.__name__) try: module.handle(text, self.mic, self.profile) - return except: self._logger.error('Failed to execute module', exc_info=True) - self.mic.say( - "I'm sorry. I had some trouble with that operation. Please try again later.") + self.mic.say("I'm sorry. I had some trouble with that operation. Please try again later.") + else: + self._logger.debug("Handling of phrase '%s' by module '%s' completed", text, module.__name__) + finally: return + self._logger.debug("No module was able to handle any of these phrases: %r", texts) -- cgit v1.3.1