v0.3.0
What's Changed
- refactor: split slogging into pretty package
- feat: add service_name to otel trace attributes
Breaking Changes
Package Structure:
sloggingpackage split intoprettyandotelpackages- Import path changes required:
// Old import "github.com/mikluko/slogging" // New import "github.com/mikluko/slogging/pretty" import "github.com/mikluko/slogging/otel"
API Changes:
New()→pretty.NewHandler()WithDestinationWriter()→WithWriter()WithOutputEmptyAttrs()→WithOutputEmptyAttrs(true)- OpenTelemetry tracing moved to separate
otel.Wrap()wrapper
New Features
OpenTelemetry Integration:
- Dedicated
otelpackage for tracing integration - Automatic extraction of
service_namefrom OpenTelemetry resources - Filters out default
unknown_service:*names - Zero overhead when no tracing context present
- Trace attributes always at root level regardless of log groups
Pretty Handler Improvements:
- Cleaner API with options-based constructor
- Exported
Encodertype for external use - Added
WithLevel()option for consistency
Performance
- Otel handler: ~1.4% overhead without tracing, ~70% with active spans
- No memory leaks: All allocations are request-scoped
- Service name extraction: Minimal 4% performance impact
Upgrade Effort: MESO
This release requires moderate effort to upgrade due to package restructuring and API changes.
Full Changelog: v0.2.0...v0.3.0