Skip to content

refactor(go): slog 구조화 로깅 및 fmt.Errorf %w 에러 체인 적용#263

Merged
kubrickcode merged 1 commit intomainfrom
develop/shlee/262
Nov 27, 2025
Merged

refactor(go): slog 구조화 로깅 및 fmt.Errorf %w 에러 체인 적용#263
kubrickcode merged 1 commit intomainfrom
develop/shlee/262

Conversation

@kubrickcode
Copy link
Owner

  • 모든 Go 코드에 slog JSON handler 설정 (log/slog 표준 라이브러리 사용)
  • log.Printf/Println/Fatal → slog.Info/Warn/Error 마이그레이션
  • errors.Wrap/Wrapf → fmt.Errorf %w 패턴으로 에러 체인 통일
  • pkg/errors 외부 의존성 제거 (go mod tidy)

fix #262

@github-actions github-actions bot added the refactor Refactoring code label Nov 27, 2025
@kubrickcode
Copy link
Owner Author

/gemini review

@gemini-code-assist
Copy link

Summary of Changes

Hello @kubrickcode, 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!

이 PR은 Go 애플리케이션 전반에 걸쳐 로깅 및 에러 처리 방식을 현대화하고 표준화합니다. log/slog를 통한 구조화된 로깅은 시스템의 가시성을 향상시키고, fmt.Errorf%w를 사용한 에러 체이닝 통일은 에러 진단 및 관리를 간소화합니다. 이러한 변경 사항은 코드의 유지보수성과 안정성을 높이는 데 기여합니다.

Highlights

  • 구조화된 로깅 도입: 모든 Go 코드에서 표준 log 패키지 대신 log/slog 패키지를 사용하여 구조화된 JSON 로깅을 적용했습니다. 이는 로그 분석 및 모니터링을 용이하게 합니다.
  • 일관된 에러 처리: errors.Wraperrors.Wrapf 대신 fmt.Errorf%w 동사를 사용하여 에러 체이닝 방식을 통일했습니다. 이를 통해 pkg/errors 외부 의존성을 제거하고 Go의 표준 에러 처리 방식을 따릅니다.
  • 의존성 정리: 불필요한 pkg/errors 의존성을 제거하고 go.modgo.sum 파일을 정리하여 프로젝트의 의존성을 최적화했습니다.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

전반적으로 훌륭한 리팩터링입니다. slog를 사용한 구조화된 로깅으로 전환하고, fmt.Errorf%w를 사용해 에러 체인을 구성하여 코드베이스 전체의 로깅 및 에러 처리 방식을 일관성 있게 개선한 점이 인상적입니다. 몇 가지 추가 개선 사항을 제안합니다.

@kubrickcode
Copy link
Owner Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

전반적으로 훌륭한 리팩토링입니다. Go 표준 라이브러리인 log/slog를 사용하여 구조화된 로깅으로 전환하고, fmt.Errorf%w를 사용하여 에러 체인을 구성한 점이 인상적입니다. 이를 통해 코드의 관찰 가능성과 디버깅 용이성이 크게 향상될 것입니다. 몇 가지 추가 개선 사항을 제안드렸으니 확인해 보시면 좋겠습니다.

- 모든 Go 코드에 slog JSON handler 설정 (log/slog 표준 라이브러리 사용)
- log.Printf/Println/Fatal → slog.Info/Warn/Error 마이그레이션
- errors.Wrap/Wrapf → fmt.Errorf %w 패턴으로 에러 체인 통일
- pkg/errors 외부 의존성 제거 (go mod tidy)

fix #262
@kubrickcode kubrickcode merged commit 3d5531d into main Nov 27, 2025
6 checks passed
@kubrickcode kubrickcode deleted the develop/shlee/262 branch November 27, 2025 15:05
@kubrickcode
Copy link
Owner Author

🎉 This PR is included in version 0.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring code released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

구조화된 로깅 (slog) + 에러 래핑 일관성

1 participant