-
1.1.0 Stable
released this
2026-03-17 14:43:28 +03:00 | 2 commits to main since this releaseWhat's changed
This release fixes a shutdown bug in
slogcaused by recursive error logging and unsafe writer ownership.Fixed
Logger.Close()no longer logswriter.Close()errors through the same logger instance- writer errors during
print/printlnno longer trigger recursivel.Error(err)calls - stdout-based writers no longer close
os.Stdout - generic
CreateTextWriter/CreateJsonWriterno longer close externally provided writers Close()now returns aggregated writer close errors instead of silently returningnil- non-closable external writers no longer cause panics on
Close()
Internal changes
- file-based writers explicitly own and close the files they create
- stdout and externally injected writers are treated as non-owning
- added regression tests for:
- writer
Print()errors without recursion - aggregated
Close()errors - safe
Close()behavior for stdout writers - safe
Close()behavior for non-owning external writers
- writer
Impact
This removes a class of hangs / recursion failures during logger shutdown and makes writer lifecycle behavior explicit and predictable.
Compatibility note
CreateTextWriter(io.Writer, ...)andCreateJsonWriter(io.Writer, ...)are now non-owning by design. If you pass a closable writer such as*os.Filethrough these constructors, closing that writer is now the caller's responsibility. If you want the logger to own the file lifecycle, useCreateTextFileWriter(...)orCreateJsonFileWriter(...).Downloads