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
  1. Windows File Path Parsing Issue Resolved

    Fixed a bug where log file paths could encounter parsing errors on Windows systems. (Commit)

  2. Backup File Handling Improvement

    Resolved a problem where setting BackupNum=0 caused all old files to be removed. (Commit)

  3. File Rotation Stability

    Fixed issues related to file rotation in short intervals, which previously caused conflicts and content overwrites. (Commit)

  4. Old File Matching Issue

    Resolved incorrect handling of file renaming (e.g., error.log to error.20250423_02.log). (Commit)

✨ New Features
  1. Enhanced Logging Configuration

    Improved the configuration functions, making it easier to fine-tune logging behavior. (Commit)

  2. Top-Level Log Function

    Introduced a Log function at the package's top level for more streamlined usage. (Commit)

🔄 Updates and Improvements
  1. WithRotateTimeString Function Added

    A new function to handle rotation time strings, along with corresponding tests. (Commit)

  2. Refactored Clean Method

    The clean method in the rotatefile handler now includes additional tests for compressing and cleaning files.(Commit)

  3. Improved Debugging Logs

    Added a debug mode environment variable and more detailed log outputs for development purposes. (Commit)

  4. 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 deprecated ioutil.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!