Skip to content

Commit

Permalink
test: log message.data for debugging (#126)
Browse files Browse the repository at this point in the history
* test: log message.data for debugging

Flaky test from #124 suggests that `message.data` might have been deformed somehow. Adding a logging for the data passed
to help debug next time something goes wrong.

* chore: update for lint

* chore: update message formatting

* chore: remove extra print

* chore: making lint happy
  • Loading branch information
dandhlee authored May 20, 2021
1 parent 6a3b706 commit 1f25195
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion securitycenter/snippets/snippets_notification_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ def receive_notifications(project_id, subscription_name):
# TODO: subscription_name = "your-subscription-name"

def callback(message):
print("Received message")

# Print the data received for debugging purpose if needed
print(f"Received message: {message.data}")

notification_msg = NotificationMessage.from_json(message.data)

Expand Down

0 comments on commit 1f25195

Please sign in to comment.