Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging #88

Merged
merged 1 commit into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ jobs:
DISCORD_APPLICATION_ID: ${{ secrets.DISCORD_APPLICATION_ID }}
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
NOTIFICATION_EMAIL: ${{ secrets.NOTIFICATION_EMAIL }}
APP_LOG_LEVEL: ${{ secrets.APP_LOG_LEVEL }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,4 @@ jobs:
DISCORD_APPLICATION_ID: ${{ secrets.DISCORD_APPLICATION_ID }}
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
NOTIFICATION_EMAIL: ${{ secrets.NOTIFICATION_EMAIL }}
APP_LOG_LEVEL: ${{ secrets.APP_LOG_LEVEL }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import re

import discord
from loguru import logger

from eternal_guesses.model.discord.discord_component import ActionRow, \
DiscordComponent, DiscordSelectOption, ComponentType
Expand All @@ -22,8 +23,7 @@ def __init__(
self.games_repository = games_repository
self.message_provider = message_provider

@staticmethod
def matches(event: DiscordEvent) -> bool:
def matches(self, event: DiscordEvent) -> bool:
return (
event.component_action is not None and
event.component_action.component_type == ComponentType.BUTTON and
Expand All @@ -41,6 +41,8 @@ async def call(self, event: DiscordEvent) -> DiscordResponse:
custom_id
).group(1)

logger.info(f"editing a guess for game_id={game_id}, guild_id={guild_id}")

game = self.games_repository.get(guild_id, game_id)

response = DiscordResponse(
Expand Down Expand Up @@ -77,6 +79,8 @@ async def call(self, event: DiscordEvent) -> DiscordResponse:
)
]

logger.debug(f"response = {response}")

return response


Expand Down