diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-26 16:48:42 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-26 17:06:00 +0200 |
| commit | 2939307120af1b8729699f649b354ab2e47637ec (patch) | |
| tree | 830d6d16c1cd7b105e90b02966198122aefde14a /client | |
| parent | 70283a4a64c625d76ebd119e46cd076f643691a6 (diff) | |
| download | jasper-client-2939307120af1b8729699f649b354ab2e47637ec.tar.gz jasper-client-2939307120af1b8729699f649b354ab2e47637ec.zip | |
Improved logging in brain.py
Diffstat (limited to 'client')
| -rw-r--r-- | client/brain.py | 10 |
1 files changed, 6 insertions, 4 deletions
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) |
