Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ekneg54 committed May 16, 2024
1 parent c8eba7b commit 6c0d92a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions logprep/connector/http/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,22 @@ def store_custom(self, document: dict | tuple | list, target: str) -> None:
error = TypeError(f"Document type {type(document)} is not supported")
self.store_failed(str(error), document, document)

def store(self, document: tuple[str, dict] | dict) -> dict:
def store(self, document: tuple[str, dict] | dict) -> None:
if isinstance(document, tuple):
target, document = document
target = f"{self._config.target_url}{target}"
else:
target = self._config.target_url
self.store_custom(document, target)

def store_failed(self, error_message: str, document_received: dict, document_processed: dict):
def store_failed(
self,
error_message: str,
document_received: dict,
document_processed: dict,
) -> None:
logger.error("Failed to send event: %s", error_message)
logger.debug("Failed event: %s", document_received)
self.metrics.number_of_failed_events += 1

def _send_post_request(self, event_target: str, request_data: bytes) -> dict:
Expand Down

0 comments on commit 6c0d92a

Please sign in to comment.