REPOSITORY / ScuroNeko/SNekLog
Releases
-
1.2.0 Stable
released this
2026-04-20 18:11:30 +03:00 | 9 commits to main since this releaseHighlights
- 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.Printno longer panics when called with no message arguments.LoggerJsonWriter.Printnow treats a trailing newline at the end of the last message as newline semantics and does not include that newline in the JSONmessagefield.- 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/colorfromv1.18.0tov1.19.0github.com/mattn/go-isattyfromv0.0.20tov0.0.21golang.org/x/sysfromv0.42.0tov0.43.0
Compatibility
No breaking API changes are intended in this release. The public
LoggerWriterinterface continues to acceptmessages ...any.Downloads
- Added message replacement with