From 4b281ca89d70d67f4027b77961d00f2b8472164f Mon Sep 17 00:00:00 2001 From: jonaswinkler <17569239+jonaswinkler@users.noreply.github.com> Date: Mon, 5 Apr 2021 00:22:11 +0200 Subject: [PATCH] logging before executing pre and post consume scripts --- src/documents/consumer.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/documents/consumer.py b/src/documents/consumer.py index 3d7d98198..8c888259f 100755 --- a/src/documents/consumer.py +++ b/src/documents/consumer.py @@ -115,6 +115,9 @@ class Consumer(LoggingMixin): f"Configured pre-consume script " f"{settings.PRE_CONSUME_SCRIPT} does not exist.") + self.log("info", + f"Executing pre-consume script {settings.PRE_CONSUME_SCRIPT}") + try: Popen((settings.PRE_CONSUME_SCRIPT, self.path)).wait() except Exception as e: @@ -135,6 +138,11 @@ class Consumer(LoggingMixin): f"{settings.POST_CONSUME_SCRIPT} does not exist." ) + self.log( + "info", + f"Executing post-consume script {settings.POST_CONSUME_SCRIPT}" + ) + try: Popen(( settings.POST_CONSUME_SCRIPT,