Skip to content

Conversation

fujiwara
Copy link
Collaborator

@fujiwara fujiwara commented Aug 1, 2025

Summary

  • Replace go.uber.org/zap with log/slog
  • Implement custom handler to maintain original log format (timestamp, level, source, message)
  • Add debug logging for all protocols (memcached, gRPC, HTTP API)
  • Remove zap dependency from go.mod

Changes

  • app.go: Implement custom slog handler with original format and replace all zap calls
  • grpc.go: Replace zap with slog and add debug logs for gRPC endpoints
  • http.go: Replace zap with slog and add debug logs for HTTP API endpoints
  • binary_protocol.go: Replace zap with slog for binary protocol
  • go.mod/go.sum: Remove zap dependency

Test plan

  • Build succeeds
  • Server starts with all protocols (memcached, gRPC, HTTP)
  • Log format matches original: 2025-08-01T22:11:28.043+0900 INFO go-katsubushi/app.go:166 Message
  • Debug logs work with -log-level debug for all protocols
  • All existing functionality preserved

🤖 Generated with Claude Code

fujiwara and others added 3 commits August 1, 2025 22:46
- Replace go.uber.org/zap with log/slog
- Implement custom handler to maintain original log format (timestamp, level, source, message)
- Add debug logging for all protocols (memcached, gRPC, HTTP API)
- Remove zap dependency from go.mod

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Use slog.SetDefault() instead of global logger variable
- Remove logger variable to prevent concurrent access
- Use slog package functions directly for thread-safe logging
- Add slog imports to all affected files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@fujiwara fujiwara merged commit 953e03b into v2 Aug 1, 2025
8 checks passed
@fujiwara fujiwara deleted the slog branch August 1, 2025 14:07
@github-actions github-actions bot mentioned this pull request Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant