REPOSITORY / ScuroNeko/SNekLog

Releases

RELEASES REPOSITORY
  • v1.2.0 14b787710c

    1.2.0 Stable

    ScuroNeko released this 2026-04-20 18:11:30 +03:00 | 9 commits to main since this release

    Highlights

    • Added message replacement with Logger.AddReplacer(old, new) for masking secrets or normalizing log output.
    • Preserved the existing LoggerWriter.Print(...any) contract, so custom writers do not need a signature update.
    • Improved JSON writer newline handling for messages that already end with \n.

    Added

    • Logger.AddReplacer(old, new) appends a replacement rule that is applied before records are sent to writers.
    • README and package GoDoc now document message replacement and include usage examples.
    • Tests covering message type preservation for custom writers, JSON empty messages, and JSON trailing newline behavior.

    Fixed

    • LoggerJsonWriter.Print no longer panics when called with no message arguments.
    • LoggerJsonWriter.Print now treats a trailing newline at the end of the last message as newline semantics and does not include that newline in the JSON message field.
    • Log messages keep their original argument types for custom writers when no replacement rules are configured.

    Changed

    • Updated the example program to demonstrate AddReplacer.
    • Updated dependencies:
      • github.com/fatih/color from v1.18.0 to v1.19.0
      • github.com/mattn/go-isatty from v0.0.20 to v0.0.21
      • golang.org/x/sys from v0.42.0 to v0.43.0

    Compatibility

    No breaking API changes are intended in this release. The public LoggerWriter interface continues to accept messages ...any.

    Downloads