Skip to content

Commit

Permalink
Debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuLamiot committed Jan 22, 2024
1 parent 3e81de4 commit f70a628
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions sources/handlers/SlackBlockActionHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down
6 changes: 5 additions & 1 deletion sources/listeners/SlackInteractionListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.')
Expand Down

0 comments on commit f70a628

Please sign in to comment.