Skip to content

Releases: arun0009/go-logger

go-logger v1.0.0

25 Feb 07:53

Choose a tag to compare

This release marks a complete modernization of the go-logger library, transitioning it to Go 1.26 with a focus on structured logging, high performance, and context awareness.

Major Highlights
Standardized Structured Logging: The Logger interface now exclusively uses keyvals ...any (consistent with Go's log/slog), ensuring a uniform API across all logging backends.

Go 1.26 Native Integration:

  • Utilizes slog.NewMultiHandler for a new NewMultiLogger helper to fan out logs to multiple destinations.
  • Utilizes slog.DiscardHandler for a zero-allocation Discard() logger.
  • Modernized all benchmarks to use the new testing.B.Loop() pattern for more accurate performance verification.

Rich Adapter Ecosystem: Full support and verified adapters for:

  • Zap (Uber)
  • Zerolog (High-performance leader)
  • Slog (Go Standard Library)
  • Logrus (Legacy support)

Deep Context Support: Native WithContext propagation. Standardized context metadata extraction across all adapters using type-safe keys to prevent collisions.

Improvements & Refactoring

  • Type Safety: Replaced all instances of interface{} with Go's any.
  • Global Accessors: Restored and modernized logger.L() and logger.ReplaceGlobals() to support both Dependency Injection and Global Singleton patterns.
  • Internal Helper: Added a logger.WithFields(ctx, keyvals...) helper for type-safe context field injection.
  • Performance: Optimized adapter implementations to minimize allocations. Benchmarks on Apple M4 show Zerolog delivering ~170 ns/op.

v0.2

08 Dec 08:44

Choose a tag to compare

v0.2

v0.1

06 Dec 03:33

Choose a tag to compare

readme installation, quick guide