FILE / ScuroNeko/SNekLog
RELEASE_NOTES.md
Исходный файл и его история в репозитории.
Add Logger.AddReplacer to mask or normalize message text before records reach writers. Document replacement behavior in README and package GoDoc, and update the example. Also fix JSON writer edge cases: - avoid panic on empty message lists - preserve newline semantics when the last message already ends with n - keep original message argument types for custom writers when no replacers are configured Update dependencies and add release notes for the next release.
1.4 KiB
1.4 KiB
v1.2.0
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.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 LoggerWriter interface continues to accept messages ...any.