From f70a628d659c00afb4001a9b9c750cd10dab0d3e Mon Sep 17 00:00:00 2001 From: Mathieu Lamiot Date: Mon, 22 Jan 2024 12:03:06 +0100 Subject: [PATCH] Debug logs --- sources/handlers/SlackBlockActionHandler.py | 1 + sources/listeners/SlackInteractionListener.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sources/handlers/SlackBlockActionHandler.py b/sources/handlers/SlackBlockActionHandler.py index 89e4725..27818f1 100644 --- a/sources/handlers/SlackBlockActionHandler.py +++ b/sources/handlers/SlackBlockActionHandler.py @@ -29,6 +29,7 @@ def process(self, payload_json): # Process the paylaod according to the callback if 'publish-release-note' == callback: + current_app.logger.info("SlackBlockActionHandler: Publish release note callback.") self.publish_release_note_callback(payload_json) else: raise ValueError('Unknown action callback.') diff --git a/sources/listeners/SlackInteractionListener.py b/sources/listeners/SlackInteractionListener.py index fc7a2ad..3007dc8 100644 --- a/sources/listeners/SlackInteractionListener.py +++ b/sources/listeners/SlackInteractionListener.py @@ -5,7 +5,7 @@ import json from flask_slacksigauth import slack_sig_auth -from flask import request +from flask import request, current_app from sources.handlers.SlackShortcutHandler import SlackShortcutHandler from sources.handlers.SlackViewSubmissionHandler import SlackViewSubmissionHandler from sources.handlers.SlackBlockActionHandler import SlackBlockActionHandler @@ -35,16 +35,20 @@ def __call__(self): # Retrieve the payload of the POST request payload_json = json.loads(request.form.get('payload')) + current_app.logger.info("SlackInteractionListener Payload: " + payload_json) # Route the request to the correct handler payload_type = payload_json['type'] response_payload = {} try: if 'view_submission' == payload_type: + current_app.logger.info("SlackInteractionListener: Processing view submission...") response_payload = self.slack_view_submission_handler.process(payload_json) elif 'shortcut' == payload_type: + current_app.logger.info("SlackInteractionListener: Processing shortcut submission...") response_payload = self.slack_shortcut_handler.process(payload_json) elif 'block_actions' == payload_type: + current_app.logger.info("SlackInteractionListener: Processing block action submission...") response_payload = self.slack_block_action_handler.process(payload_json) else: raise ValueError('Unknown payload type.')