Skip to content

Commit

Permalink
update exception logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume De Saint Martin committed Feb 22, 2020
1 parent e81996f commit 3ce6f0c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions octobot_evaluators/api/evaluators.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ async def create_evaluator(evaluator_class,
await eval_class_instance.start_evaluator()
return eval_class_instance
except Exception as e:
get_logger().error(f"Error when creating evaluator {evaluator_class}: {e}")
get_logger().exception(e)
get_logger().exception(e, True, f"Error when creating evaluator {evaluator_class}: {e}")
return None


Expand Down
2 changes: 1 addition & 1 deletion octobot_evaluators/channels/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def consume(self):
except CancelledError:
self.logger.warning("Cancelled task")
except Exception as e:
self.logger.exception(f"Exception when calling callback : {e}")
self.logger.exception(e, True, f"Exception when calling callback : {e}")


class MatrixChannelProducer(Producer):
Expand Down
3 changes: 1 addition & 2 deletions octobot_evaluators/evaluator/abstract_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ async def evaluation_completed(self,
# if ConfigManager.is_in_dev_mode(self.config): # TODO
# raise e
# else:
self.logger.error("Exception in evaluation_completed(): " + str(e))
self.logger.exception(e)
self.logger.exception(e, True, f"Exception in evaluation_completed(): {e}")
finally:
if self.eval_note == "nan":
self.eval_note = START_PENDING_EVAL_NOTE
Expand Down
3 changes: 1 addition & 2 deletions octobot_evaluators/evaluator/social_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ async def start(self) -> None:
get_service_feed(self.SERVICE_FEED_CLASS).update_feed_config(self.specific_config)
await get_chan(self.SERVICE_FEED_CLASS.FEED_CHANNEL.get_name()).new_consumer(self._feed_callback)
except ImportError as e:
self.logger.error("Can't start: requires OctoBot-Services package installed")
self.logger.exception(e)
self.logger.exception(e, True, "Can't start: requires OctoBot-Services package installed")

@abstractmethod
async def _feed_callback(self, *args):
Expand Down

0 comments on commit 3ce6f0c

Please sign in to comment.