[FIX] Discord 로깅 시 예외 발생 처리 개선#175
Conversation
Discord 로깅 과정에서 예외가 발생했을 때, 문제 인지를 위해 오류 메시지를 stderr에 출력하도록 개선한다. 기존에는 JSON 로깅 관련 라이브러리를 사용했으나, 현재는 사용하지 않으므로 관련 설정을 제거한다.
Summary of ChangesHello @wlswnsdn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on improving the reliability and maintainability of the application's Discord logging functionality. It addresses error handling by ensuring that logging failures are surfaced through stderr, and it cleans up obsolete library configurations to simplify the project's dependencies and improve overall code health. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
🤖 Gemini AI 코드 리뷰❌ Gemini API 호출 실패: 최대 재시도 횟수 초과 이 리뷰는 Gemini AI가 자동으로 생성했습니다. 참고용으로만 활용해주세요. |
There was a problem hiding this comment.
Code Review
이 PR은 Discord 로깅 시 발생하는 예외 처리를 개선하고, 더 이상 사용하지 않는 python-json-logger 의존성을 제거하는 좋은 변경입니다. 특히 로깅 실패 시 traceback.print_exc()를 사용하여 오류를 출력하도록 변경한 점은 문제 해결에 큰 도움이 될 것입니다. 또한, main.py에서 발생했던 로깅 설정 함수 이름 충돌 문제를 해결하여 기본 로깅이 올바르게 설정되도록 수정한 점도 매우 중요한 개선입니다. 코드 명확성을 높이기 위해 main.py에서 setup_logging 함수를 alias하는 대신, external/log/discord_config.py에서 직접 함수명을 변경하는 것을 제안하는 리뷰 의견을 남겼습니다. 전반적으로 코드의 안정성과 유지보수성을 높이는 훌륭한 수정입니다.
| from response.api_response import ApiResponse | ||
| from response.code.status.success_status import SuccessStatus | ||
| from external.log.discord_config import setup_logging | ||
| from external.log.discord_config import setup_logging as setup_discord_logging |
There was a problem hiding this comment.
함수명을 setup_discord_logging으로 alias하여 사용하신 것을 보니, external/log/discord_config.py에 있는 setup_logging 함수의 역할이 디스코드 로깅 설정에 한정된다는 점을 잘 파악하고 계신 것 같습니다. 코드의 명확성과 유지보수성을 위해, external/log/discord_config.py 파일에서 직접 함수명을 setup_discord_logging으로 변경하고, main.py에서는 alias 없이 import하는 것을 제안합니다.
이렇게 하면 다른 개발자가 코드를 볼 때 함수의 역할을 더 쉽게 파악할 수 있습니다.
이 제안을 적용하시려면 external/log/discord_config.py의 setup_logging 함수 이름도 setup_discord_logging으로 변경해야 합니다.
| from external.log.discord_config import setup_logging as setup_discord_logging | |
| from external.log.discord_config import setup_discord_logging |
* [FEAT] 에러 로그 발생 시 디코 웹훅 오도록 구현 * [FEAT] JSON 로깅 설정 추가 (#172) * [FEAT] JSON 로깅 설정 추가 ENV 환경변수에 따라 로깅 포맷을 JSON 또는 색상 콘솔로 설정한다. prod 환경에서는 JSON 포맷을 사용하여 로깅하고, 그 외 환경에서는 색상 콘솔 포맷을 사용한다. uvicorn 로거에도 동일한 포맷을 적용하여 일관성을 유지한다. * [FIX] JSON 로깅 포맷 커스텀 기능 추가 기존 `pythonjsonlogger` 라이브러리 사용에서 `logging.Formatter`를 상속받아 JSON 로깅 포맷을 커스텀하도록 변경 - `@timestamp` 필드에 timezone 정보가 포함된 ISO 포맷 적용 - 개발 환경이 아닌 경우, JSON 포맷 로깅 적용 * [FIX] ASG 최소 정상 인스턴스 비율 조정 오토 스케일링 그룹의 최소 정상 인스턴스 비율을 50%에서 100%로 변경하여 안정적인 배포를 보장한다. * [FIX] Discord 로깅 시 예외 발생 처리 개선 (#175) Discord 로깅 과정에서 예외가 발생했을 때, 문제 인지를 위해 오류 메시지를 stderr에 출력하도록 개선한다. 기존에는 JSON 로깅 관련 라이브러리를 사용했으나, 현재는 사용하지 않으므로 관련 설정을 제거한다. --------- Co-authored-by: changmin <ml505050@naver.com> Co-authored-by: chang min O <82094699+Ochangmin524@users.noreply.github.com>
Discord 로깅 과정에서 예외가 발생했을 때, 문제 인지를 위해 오류 메시지를 stderr에 출력하도록 개선한다.
기존에는 JSON 로깅 관련 라이브러리를 사용했으나, 현재는 사용하지 않으므로 관련 설정을 제거한다.
PR 제목
[Feat/Fix/Refactor/Docs/Chore 등]: 간결하게 변경 내용을 요약해주세요. (예: Feat: 사용자 로그인 기능 구현)
✨ 변경 유형 (하나 이상 선택)
📚 변경 내용
구체적으로 어떤 변경 사항이 있는지, 왜 이러한 변경이 필요한지 설명해주세요.
(예: 사용자 회원가입 시 이메일 중복 확인 로직 추가. 기존 로직에서 누락된 부분 발견하여 수정.)
⚙️ 주요 작업 (선택 사항)
✅ 체크리스트
🔗 관련 이슈 (선택 사항)
해당 PR이 해결하는 이슈 또는 관련 있는 이슈가 있다면 링크를 걸어주세요.
(예: #123, ABC-456)
💬 기타 (선택 사항)
리뷰어에게 전달하고 싶은 추가 정보나 궁금한 점이 있다면 작성해주세요.