Agent: Add log statements in class `push_all_events_to_island`'s `__call__()`

This commit is contained in:
Shreya Malviya 2022-09-12 18:57:39 +05:30
parent 1462e832b0
commit a06c6a622e
1 changed files with 5 additions and 1 deletions

View File

@ -16,9 +16,13 @@ class push_all_events_to_island:
self._server_address = server_address
def __call__(self, event: AbstractAgentEvent, topic=pub.AUTO_TOPIC):
topic_name = topic.getName()
logger.debug(f"Pushing event of type {topic_name} to the Island at {self._server_address}")
requests.post( # noqa: DUO123
"https://%s/api/events" % (self._server_address,),
data=self._serialize_event(event, topic.getName()),
data=self._serialize_event(event, topic_name),
headers={"content-type": "application/json"},
verify=False,
timeout=MEDIUM_REQUEST_TIMEOUT,