def METHOD_NAME(self, loop, context):
    loop_str = "bot main async" if loop is self.async_loop else {loop}
    message = f"Error in {loop_str} loop: {context}"
    exception = context.get('exception')
    if exception is not None:
        formatted_traceback = "\n".join(traceback.format_tb(exception.__traceback__))
        message = f"{message}:\n{formatted_traceback}"
    self.logger.warning(message)