Skip to content

Commit

Permalink
Use custom logger in ChallengeFeedbackURLView
Browse files Browse the repository at this point in the history
  • Loading branch information
taoky committed Oct 24, 2024
1 parent d8227aa commit 1fbd3f8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

from frontend.models import Account, AccountLog, Credits, Qa, SpecialProfileUsedRecord, UnidirectionalFeedback

import logging

logger = logging.getLogger('custom')


# noinspection PyMethodMayBeStatic
class HubView(View):
Expand Down Expand Up @@ -315,6 +319,7 @@ def post(self, request, challenge_id):
response.raise_for_status()
except (requests.exceptions.RequestException, requests.exceptions.HTTPError) as e:
messages.error(request, "反馈发送失败,请向管理员反馈此问题。")
logger.exception("反馈发送失败")
return TemplateResponse(request, 'challenge_feedback.html', {
"challenge_name": challenge_name,
"too_frequent": too_frequent,
Expand Down

0 comments on commit 1fbd3f8

Please sign in to comment.