We’re thrilled to announce the release of gookit/slog v0.5.8, a significant update to the lightweight, configurable, and extensible logging library for Go. With this release, we’ve addressed critical bug fixes, introduced powerful new features, and refined the overall functionality to offer an even more reliable logging experience for developers.
Github: https://github.com/gookit/slog
Highlights of v0.5.8
🛠️ Bug Fixes
Windows File Path Parsing Issue Resolved
Fixed a bug where log file paths could encounter parsing errors on Windows systems. (Commit)Backup File Handling Improvement
Resolved a problem where settingBackupNum=0
caused all old files to be removed. (Commit)File Rotation Stability
Fixed issues related to file rotation in short intervals, which previously caused conflicts and content overwrites. (Commit)Old File Matching Issue
Resolved incorrect handling of file renaming (e.g.,error.log
toerror.20250423_02.log
). (Commit)
✨ New Features
Enhanced Logging Configuration
Improved the configuration functions, making it easier to fine-tune logging behavior. (Commit)Top-Level
Log
Function
Introduced aLog
function at the package's top level for more streamlined usage. (Commit)
🔄 Updates and Improvements
WithRotateTimeString
Function Added
A new function to handle rotation time strings, along with corresponding tests. (Commit)Refactored Clean Method
The clean method in therotatefile
handler now includes additional tests for compressing and cleaning files.(Commit)Improved Debugging Logs
Added a debug mode environment variable and more detailed log outputs for development purposes. (Commit)Optimized Rotate File Logic
Refactored the logic to ensure file extensions are always at the end and reduced lock ranges during write and rotation processes. (Commit)
📦 Dependency Updates
- Updated
github.com/gookit/goutil
to v0.6.18. (PR #153) - Updated
github.com/golang/glog
from v1.1.1 to v1.2.4 for examples. (PR #157)
🧪 Improved Test Coverage
- Added more unit test cases and internal test functions to ensure the stability and reliability of new features. (Commit)
Acknowledging New Contributors
We’re excited to welcome two new contributors to the gookit/slog community:
-
@ShyunnY for their work on the
CallerFlagMode
type alias. (PR #155) -
@knbr13 for updating the code to use
os.ReadFile
instead of the deprecatedioutil.ReadFile
. (PR #158)
Full Changelog
To explore all changes in detail, check out the v0.5.8 changelog.
This release represents a significant step forward in making gookit/slog
a more robust, flexible, and user-friendly logging solution for Go developers. We’re grateful for the contributions from the community and look forward to seeing how these changes will enhance your projects.
Happy Logging!