cloud-sql-proxy
cloud-sql-proxy copied to clipboard
refactor: replace zap with slog
trafficstars
This PR replaces the third-party Zap logging library with Go's standard library slog package for structured logging. This change reduced the number of dependencies while maintaining the same logging functionality and format.
Fixes #2120
Changes
- Removed dependencies on
go.uber.org/zapandgo.uber.org/zap/zapcore - Added usage of Go's standard library
log/slogpackage - Simplified the
StdLoggerstructure by combininginfoLoganddebugLoginto a singlestdLog - Refactored the
StructuredLoggerto useslog.Loggerinstead of Zap'sSugaredLogger - Modified the
NewStructuredLoggerfunction to usesloghandlers and configuration - Added a new
replaceAttrfunction to maintain compatibility with Google Cloud Logging format - Ensured that log messages continue to adhere to the LogEntry format for Google Cloud Logging